Inter-App Communication

There were several attempts to establish the universal, multi-platform, asynchronous way of data exchange from the web applications to native apps or another web apps and up to date no standardized solution was concieved.

There are, however, some basic workarounds for sending data to another applications. Native applications can register handlers to receive data from the web apps using special URL prefixes (although differences exist between iOS and Android). There are also third-party non-standard services that coordinate sharing data between web applications.

Google Chrome 18 implemented the Web Intents experimental API. It was conceptually based on Android Intents system. The apps interested in receiving data were required to be registered in Chrome Web Store and declare the intent support in the manifest file. The apps sending the data were able to invoke the Intent of the particular type and let the system handle the selection of the target application and its proper invocation. The API was removed in Chrome 24 because of various interoperability and usability issues. No other vendor implemented Web Intents.

The newest implementation, Web Share API, as of September 2017 available in Chrome on Android, is much simpler and consists of a method to invoke the platform-specific share mechanism and is limited to sharing named URLs only. There is a complementary Web Share Target API in an early design phase to allow registering web applications as the share receivers.

API glimpse

Web Intents API

intent = new Intent(action, type, href)
Creates an object representing the request for a particular action (command) to be sent to the registered handling applications.
navigator.startActivity(intent, onSuccess, onFailure)
Invokes the system-defined application selection and data share dialog to send the request to another application.
window.intent.postResult(result)
Sends the result from the requested (target) application back to the requesting (source) application.

Web Share API

navigator.share({name, title, url})
Invokes the system-defined application selection and data share dialog to send the named URL to another application and returns a Promise resolved when the share was successful.

Resources