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.