Disable “Add to home screen” if native App with TWA (Trusted Web Activities) is installed

1.2k views Asked by At

Initial situation: I installed a native app with a TWA on my Android phone that opens lets say "www.example.com" and I was able to turn off the app installation prompt with the instructions here. https://web.dev/get-installed-related-apps/#check-android (Add related_application to manifest)

Now when I open the Google Chrome browser on Android and enter the URL "www.example.com", then there is no more installation prompt popup but when I go to the three dots its still possible to click “Add to Home screen” and then the PWA is installed as webapk.Add to homescreen

Now my question is it possible to disable this option or have the same behaviour as for an installed PWA (as described below)?

PWA behaviour:

  1. Go to "www.example.com"
  2. 3 dots, Install app Install app
  3. If webapk is installed on the device, again go to www.example.com
  4. Go to the three dots, then you see open PWA, and it is not possible to install the PWA again.Open PWA

Can I have this behaviour when I install the PWA as a native app with TWA? TWA generation happens with bubblewrap (https://github.com/GoogleChromeLabs/bubblewrap)

1

There are 1 answers

0
PeteLe On

It's not possible to prevent the user from trying to install from the 3-dot menu. If you'd like, head over to https://new.crbug.com to file a feature request and we can take a look at it.