1

I'm looking to launch a single web app that works as a PWA for web users and a TWA for users wanting to download it from the Google Play Store. The app includes a yearly subscription so I'll need to implement separate payments methods for the PWA and TWA in order to comply with Google Play policies.

With this being said, is there a way to identify with JS if the user is viewing the PWA vs the TWA app from the play store? Perhaps something unique to check in the global window object?

Or, is it recommended to publish a whole new version of the app used for the TWA to a different URL that only supports the Google Play payment option.

Any info would be great. Thanks in advance.

  • Have you tried the solution at https://stackoverflow.com/questions/54580414/how-can-i-detect-if-my-website-is-opened-inside-a-trusted-web-actvity/54580415#54580415? – andreban Aug 04 '21 at 17:56
  • 1
    Thanks for sending over the link. However after trying the suggestions in the post I came to the conclusion none of those suggestions are ideal. Option 1 - (Using the referrer android-app://) This didn't work consistently. Option 2 - (Adding an URL parameter to startUrl). This solution doesn't work when users are deeplinked to a different part of the app from an external link. Option 3 - Not yet supported by all browsers. I have a subscription in my app and need to make sure to use Play Billing in all browser-types. Not just the main ones that are supported. – Andy Geslison Aug 17 '21 at 03:11

0 Answers0