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?
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.
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.
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.
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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With