PWA:如何在安装提示前重新触发? [英] PWA: How to retrigger beforeinstallprompt?

查看:242
本文介绍了PWA:如何在安装提示前重新触发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的网站使用PWA,以便访问者可以选择添加到主屏幕(A2HS).但是,根据Google Analytics(分析)数据,与不接受率相比,不合格率太高.

Our site uses PWA so that the visitor can choose to Add to Home Screen (A2HS). However, from Google Analytics data, the Dismiss rate is too high compared to Acceptance rate.

我们计划使UX更加直观和清晰,以提高接受率.但是,我们也想让那些已经解散了A2HS对话框的访问者复活.

We plan to make the UX more intuitive and clearer to improve the acceptance rate. However, we also want to revive those visitors already dismissed the A2HS dialog.

如何这样做?据我所知,我们只能添加beforeinstallprompt侦听器,但没有openinstallprompt方法.

How to do so? To the extend of my knowledge, we only can add beforeinstallprompt listener but there is no openinstallprompt method.

推荐答案

否,您无法触发安装横幅及其由浏览器驱动.如果您的站点符合所有PWA标准,并且用户访问频率足够高(浏览器供应商未明确说明频率是否足够高),浏览器将再次显示提示.我们无法使用我们的代码触发相同的事件. 请参阅此答案,了解其行为方式以及替代解决方案.

No, You can't trigger the install banner and its driven by the browsers. If your site meets all PWA criteria and if the user is visiting frequent enough(how frequent enough is not explicitly stated by browser vendors), browsers will show the prompt again. We can't trigger the same with our code. Refer this answer on why it behaves that way and whats the alternate solution.

这篇关于PWA:如何在安装提示前重新触发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆