how to add to 'Add to homescreen' popup for android mobile [duplicate]

爷,独闯天下 提交于 2020-01-02 04:29:25

问题


Does anyone know any example, how I can show popup message for 'Add to homescreen' in chrome. In my web app I wanna show popup message first time user open web app to save short cut icon. Using html5 and jquery. (so that my webapp will run as native app next time).


回答1:


Since Chrome 42 there is now a standard way of accomplishing this that prompts the user to add your application to the home screen as long as your web application fulfills the following requirements:

  • You have a web app manifest file
    • The manifest defines how your app appears on the user’s system and how it should be launched - and you are required to have a short_name and a 144x144 png icon
    • Your icon declarations should include a mime type of image/png
  • You have a service worker registered on your site. We recommend a simple custom offline page service worker
  • Your site is served over HTTPS (you need a service worker after all)
  • The user has visited your site twice over two separate days during the course of two weeks.


来源:https://stackoverflow.com/questions/25199615/how-to-add-to-add-to-homescreen-popup-for-android-mobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!