PWA: How to programmatically trigger : “Add to homescreen”? on iOS Safari

前端 未结 2 1514
挽巷
挽巷 2020-12-12 22:33

I released a server rendered progressive web app recently and everything works great so far. However, Android using chrome shows a banner to download the app which is awesom

相关标签:
2条回答
  • 2020-12-12 23:23

    For now, Apple doesn't give the possibility to make this "Add to home screen" experience easy.

    You can provide a tooltip explanation to your users though, for IOs users:

    Details explained here: https://www.netguru.com/codestories/few-tips-that-will-make-your-pwa-on-ios-feel-like-native

    in the section: PROTIP 3: Create an “Add to home screen” popup yourself!

    0 讨论(0)
  • 2020-12-12 23:28

    iOS - Safari currently don't support Web app install banner, like in Android - Chrome.

    There is no way to programatically trigger install banner in Android as well, except for the case when you catch the beforeInstallPromot and use that to show the banner.

    In the linked answer, you can check on the alternate option on how to show in app banner to guide user to add to home screen. Here is some code example for the same, which is iOS specific(look under #PROTIP 3).

    0 讨论(0)
提交回复
热议问题