Reputation: 31
i have a question I've got a PWA and i want to open it from another application using the url like mypwascheme:http://my.test.host/mypage
But i have no idea what should i use for the scheme part, ie. mypwascheme
I tried my app's name & short name from the manifest.json but neither did work
Any ideas? Thanks in advance
Upvotes: 3
Views: 1616
Reputation: 1557
You can use Android Intent Filters. So basically, you can simply have a web link (a normal URL like http://my.test.host/mypage ) embedded into your application. When this tries to open it in the browser, the PWA app intercepts the request (if you have the intent filters defined in your manifest) and open it up there.
Example (using your sample URL):
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="http"
android:host="my.test.host"
android:pathPrefix="/mypage/" />
</intent-filter>
Upvotes: 1