如何添加到Android手机的“添加到主屏幕”弹出窗口 [英] how to add to 'Add to homescreen' popup for android mobile

查看:645
本文介绍了如何添加到Android手机的“添加到主屏幕”弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道任何示例,我如何在chrome中显示添加到主屏幕的弹出消息。
在我的网络应用程序中,我想显示弹出消息第一次用户打开网页应用程序以保存快捷方式图标。使用html5和jquery。 (这样我的webapp将在下次作为原生app运行。)

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).

推荐答案

Chrome 42 现在有一种标准方式完成此操作,提示用户只要您的网站将您的应用程序添加到主屏幕应用程序满足以下要求:

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:



  • 您有一个Web应用程序清单文件


    • 清单定义了您的应用在用户系统中的显示方式以及应如何启动 - 并且您需要拥有 short_name 和a 144x144 png图标

    • 您的图标声明应包含mime类型的图像/ 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 a 144x144 png icon
    • Your icon declarations should include a mime type of image/png

这篇关于如何添加到Android手机的“添加到主屏幕”弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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