Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a progressive web app be registered as a share option in Android?

Total newbie question.

Tl;dr - Can a progressive web app be registered as a share option in Android?

In Android, we can “Share” things to other installed Android apps. For example, let’s say I have Chrome for Android and the Google+ app installed on my Android device. I can share a web site which I am viewing in Chrome to Google+ by going to Chrome’s hamburger menu → Share… → Google+ (with a list of other installed native apps). Can a progressive web app be registered in this list of installed native apps? If yes, can you show me some examples or code labs? If no, is this feature in progressive web app or Android’s roadmap?

like image 936
fung Avatar asked Jul 04 '16 16:07

fung


People also ask

How do I share my progressive web app?

You can share to the app by registering it as a share target, with the Web Share Target API. This is done through an entry in the manifest file. These two advanced capabilities help your PWA integrate seamlessly with your platform, and create a smooth, unified sharing experience.

Does Android support progressive Web Apps?

You can use Progressive Web Apps (PWAs) for a fast web experience on your computer or mobile device. You can install the PWA for faster access and additional functionality, like more storage for content to use offline.

Can PWA be uploaded to Google Play store?

aab - Your PWA's Android App Bundle. This is the file you will upload to the Google Play Store. app-release-signed. apk - An Android packaging format that can be used to install the application directly to a development device using the bubblewrap install command.

Is a progressive Web App a mobile app?

Progressive Web Apps are something between a responsive website and a mobile app. They are mobile sites built with modern JavaScript frameworks, designed to work like a native app. They can be added to a mobile device's home screen with an icon. Like apps, they offer a full-screen experience to engage users.


2 Answers

Since recently a PWA can register itself as a Share target, via manifest.json.

Please read more here: https://developers.google.com/web/updates/2018/12/web-share-target

like image 73
KIR Avatar answered Oct 04 '22 12:10

KIR


Yes. Now, you can do it on Chrome for Android from version 71+.

Assuming you have all the basics of PWA nailed down (HTTPS, registered service worker, and manifest) you only need to add the following section into your manifest.json:

  "share_target":   {     "action": "/share",     "params":     {       "title": "title",       "text": "text",       "url": "url"     }   }, 

I wrote a more detailed tutorial if you get stuck at any stage.

like image 35
Jakub Chodounsky Avatar answered Oct 04 '22 11:10

Jakub Chodounsky