1

I try to usw pwa with samsung internet browser. But i cant trigger the the userchoice event of the prompt.

the code looks like this:

  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;
        });
 })

In chrome i get the event of userchoice but in samung internet happens nothing... Can anybody help me in this topic?

thanks in advance

greets Roman

Roman
  • 19
  • 2
  • The `beforeinstallprompt` event is [available in Samsung Internet >= 5 only](https://caniuse.com/#search=beforeinstallprompt). – Mike Doe Jan 16 '20 at 07:39
  • hi emix, thanks for your quick reply. i'm using 10.2. – Roman Jan 16 '20 at 07:41
  • Does this answer your question? [PWA - beforeinstallprompt not called](https://stackoverflow.com/questions/50762626/pwa-beforeinstallprompt-not-called) – Mike Doe Jan 16 '20 at 07:47
  • unfortunately not, the userchoice (promise) event doesn't fire in samsung browser. in chrome it works properly. – Roman Jan 16 '20 at 08:41

0 Answers0