See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

PWA interoperability with Android apps/services?

General Tech Bugs & Fixes

Max. 2000 characters



( 6 months ago )

We know that some of our code must be in native code, but it can be encapsulated as an Android service. We would like to create the UI-oriented part as a progressive web app (PWA).

Is there a way for the PWA to interact with native apps on the device (e.g., call them with parameters and handle replies/broadcasts of the other app)?

Can the PWA call intents, be called as an intent, etc? What are the possibilities?



( 6 months ago )


Sending Share Intent (via Web Share API)

At the Chrome Dev Summit 2016, the team announced the Web Share API, which allows PWAs to invoke the native sharing capabilities of the device (e.g., see Android demo video) in response to a user gesture (e.g., by clicking a link; cannot be automatic). The API is very new and behind an origin trial.

The following example click-handler invokes the Share Intent, which brings up the native app picker to share data with a user-chosen app. Passing a URL (optional) allows that app to provide a link to the user e.g. for a detail view.

function onClick() {
        title: document.title,
        text: "Hello World",
        url: window.location.href
    }).then(() => console.log('Successful share'))
    .catch(error => console.log('Error sharing:', error));

Sending Android Intents from Chrome

It's possible to send an Android intent from a PWA with intent URLs. This method also requires a user gesture to initiate (e.g., by clicking a link; cannot be automatic).

The intent syntax is:

   HOST/URI-path // Optional host 

For example, clicking this anchor tag launches the ZX Barcode Scanner app:

<a href="intent://scan/#Intent;scheme=zxing;;end"> Take a QR code </a>

Receiving Android Intents

I found nothing on PWAs receiving intents or broadcast messages from native apps. I don't think it's possible.

what's your interest