在非Chrome浏览器中,Progress Web App出现提示问题

问题描述 投票:0回答:1

我试图通过SAMSUNG Internet将网页发布为PWA应用程序。我想使用自定义的“添加到主屏幕”弹出窗口。为此,我必须使用以下事件,并且我想听听用户的选择。在Chrome中,用户选择会在用户选择后触发。但是在三星互联网上它对此没有反应......有人可以帮我吗?

谢谢

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;
   });
})
android google-chrome install progressive-web-apps prompt
1个回答
0
投票

来自caniuse Samsung Internet不支持beforeinstallprompt,并且不支持appinstalled事件。

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

因此您将完全无法以这种方式使用它。

caniuse屏幕截图截至2020-04-13caniuse scrot as of 2020-04-13

© www.soinside.com 2019 - 2024. All rights reserved.