简体   繁体   English

如何识别来自iPhone“主屏幕”的用户点击

[英]How to identify user click from iphone “home screen”

Some users of my mobile site add the site to home screen in safari in iPhone (using "add to home screen"). 我的移动网站的某些用户将该网站添加到iPhone的野生动物园中的主屏幕中(使用“添加到主屏幕”)。 Is there any way to know if they come from clicking the home icon, or typing the url? 有没有办法知道它们是否来自单击主页图标或键入URL?

Or, to solve my problem, I want know how many users "add to home screen" and come back 或者,要解决我的问题,我想知道有多少用户“添加到主屏幕”并返回

Many thanks Bob 非常感谢鲍勃

I've tested it by setting up a webserver on my mac. 我已经通过在Mac上设置网络服务器进行了测试。 The difference when starting the site from a webclip is, that mobile safari sends out additional requests for the homescreen icon: 从Webclip启动网站的区别在于,移动浏览器会向主屏幕图标发送其他请求:

GET /apple-touch-icon-57x57-precomposed.png HTTP/1.1
Host: 10.0.2.1
User-Agent: MobileSafari/6533.18.5 CFNetwork/485.12.7 Darwin/10.4.0
Accept: */*
Accept-Language: de-de
Accept-Encoding: gzip, deflate
Connection: keep-alive

Other observed requests are: 其他观察到的请求是:

GET /apple-touch-icon-57x57.png HTTP/1.1

GET /apple-touch-icon-precomposed.png HTTP/1.1

GET /apple-touch-icon.png HTTP/1.1

You could check for those GET-Requests on the server. 您可以在服务器上检查那些GET请求。

I don't know if this happens everytime when clicking the webclip or only once. 我不知道是否每次单击Webclip时都会发生这种情况,还是只有一次。

That's it ! 而已 ! I guess you can't ! 我猜你不能! You are not supposed to know what a user does outside of your application (of any kind, thanks BoltCloch ;-)). 您不应该知道用户在您的应用程序之外做什么(任何形式,感谢BoltCloch ;-)。 That's the whole principle of sand-boxed environment. 这就是沙盒环境的全部原理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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