Beforeinstallprompt event?

window.addEventListener('beforeinstallprompt', (e) => {
    console.log('addToHomeScreen beforeinstallprompt');
    e.preventDefault(); 
    deferredPrompt = e; 
	console.log('deferredPrompt set:', deferredPrompt);
    addBtn.style.display = 'block'; 
   // addSamsungBtn.style.display = 'block';
});

Why doesn’t beforeinstallprompt work in Samsung browser?
It works in Google Chrome.

Hello,

Thank you for posting on the Samsung Developers Forums.

According to the Samsung internet team, the issue with beforeinstallprompt has been solved. You can try testing it using this website: https://mlearn-pwa-web-app-install-prompt.glitch.me/. If the issue persists on your website, please give me a website link where we can replicate the issue. I will forward it to the development team.

Sincerely,
Samiul Hossain
Samsung Developer Forums

hi, i’m pwa develop, i;m run pwa in android samsung internet browser of version 27.x, and found the same problem, not fired “beforeinstallprompt”, and the https://mlearn-pwa-web-app-install-prompt.glitch.me/ not running.


second image is my code, and i’m try print

window.addEventListener('beforeinstallprompt', (e) => {
        console.log(' window.addEventListener beforeinstallprompt success');
        localStorage.setItem('installFinish', "0")
        setShowInstall(true);
        e.preventDefault();
        e.stopPropagation();
        e.stopImmediatePropagation();
        window.deferredPrompt = e;
      });
console.log('window-----------', window, window.deferredPrompt)

get window.deferredPrompt result is undefined