简体   繁体   中英

Is there way to only show the PWA 'Add to Home Screen' on index?

We have a PWA that works great and the "add to home screen" also works great. The problem is, for users that just want to start using the app, have our primary action button covered by that prompt.

Unless they accept or dismiss the prompt, they wont be able to continue using our app.

What we would prefer is if the user navigates away from the home page towards actually using our PWA, we automatically dismiss the "add to home screen" button. Is this possible?

Changes to Add to Home Screen Behavior

Starting in Chrome 68 on Android (Stable in July 2018), Chrome will no longer show the add to home screen banner. If the site meets the add to home screen criteria, Chrome will show the mini-infobar. Then, if the user clicks on the mini-infobar, or you call prompt() on the beforeinstallprompt event from within a user gesture, Chrome will show a modal add to home screen dialog.

Ref: https://developers.google.com/web/updates/2018/06/a2hs-updates

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM