如何添加到'添加到主屏幕'弹出的Android手机
问题描述:
没有人知道任何示例吗,我如何在Chrome中显示添加到主屏幕"的弹出消息. 在我的Web应用程序中,我想在用户第一次打开Web应用程序以保存快捷方式图标时显示弹出消息.使用html5和jquery. (这样我的Web应用程序下次即可作为本机应用程序运行.)
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).
答
完成此操作,只要您的Web应用程序满足以下要求,就会提示用户将您的应用程序添加到主屏幕:
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:
- 您有一个网络应用清单文件
- 清单定义了您的应用在用户系统上的显示方式以及启动方式-您必须具有
short_name
和144x144
png图标- 您的图标声明应包含image/png的哑剧类型
- 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 a144x144
png icon- Your icon declarations should include a mime type of image/png