简体   繁体   中英

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.

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

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM