TheTOXIN
TheTOXIN

Reputation: 53

How to open the TWA application on the links with my URL?

I have a TWA application. When I receive FCM push notifications, with a link to my PWA site, clicking on them opens the Chrome browser. But I need all the links to my site to open my TWA application.

Upvotes: 0

Views: 1837

Answers (2)

kumudgupta76
kumudgupta76

Reputation: 384

For that you need to add assets links to your site

At {your-domain}/.well-known/assetlinks.json

and assetlinks.json you will get while creating TWA as-

go to tools(android studio)->App Links Assistant->Associate Website(Open digital Assets files link generator)

there you can generate assetslinks for your site after filling relevant information.

To get more info follow: https://developers.google.com/digital-asset-links/v1/getting-started

Upvotes: 2

TheTOXIN
TheTOXIN

Reputation: 53

I found a solution, just add this to your AndroidManifest.xml:

<application>
   ...
    <meta-data
        android:name="cros_web_alternative"
        android:value="https://www.example.com/" /> 
   ...
</application>

Upvotes: 1

Related Questions