PWA compatible with Android apps / services?

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

Is there a way that PWA can interact with native applications on the device (for example, call them with parameters and process the responses / translations of another application)?

Can a PWA call be called, called as intention, etc.? What are the possibilities?

+4
source share
1 answer

Submit Share Intent (via web access API)

Chrome Dev Summit 2016 - API, PWA (, . Android) (, , ). API .

click-handler Share Intent, . URL () , . .

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

Android Intents Chrome

Android PWA URL- . , (, , ).

:

intent:
   HOST/URI-path // Optional host 
   #Intent; 
      package=[string]; 
      action=[string]; 
      category=[string]; 
      component=[string]; 
      scheme=[string]; 
   end; 

, - ZX:

<a href="intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;end"> Take a QR code </a>

Android

PWA, . , .

+5

Source: https://habr.com/ru/post/1662220/


All Articles