Dr Web
Dr Web

Reputation: 13

Progress Web App Prompt choise problem in not chrome browsers

I try to publish a web page as as PWA app with SAMSUNG internet. I would like to use a custom "Add to home screen" pop up. For this i have to use the following event and i like to listen to the user choice. In Chrome the user choice does fire after the user choice... but in SAMSUNG internet it doesn't react to this... ... can somebody helps me with this?

Thanks

window.addEventListener('beforeinstallprompt', function (e) {

   deferredPrompt = e;
   deferredPrompt.preventDefault();

   deferredPrompt.then((choice) => {
   if (choice.outcome === 'accepted') {
      console.log('User accepted the A2HS prompt');
   } else {
      console.log('User dismissed the A2HS prompt');
   }
   // Clear the saved prompt since it can't be used again
      installPromptEvent = null;
   });
})

Upvotes: 0

Views: 277

Answers (1)

JensV
JensV

Reputation: 4544

From caniuse Samsung internet does not support the beforeinstallprompt and appinstalled events.

Ref: https://caniuse.com/#feat=web-app-manifest

So you won't be able to use it this way at all.

caniuse screenshot as of 2020-04-13 caniuse scrot as of 2020-04-13

Upvotes: 2

Related Questions