Web based method to determine if an iPhone is connected via 3G or Wifi

点点圈 提交于 2019-12-11 10:15:02

问题


I'm in the process of building a webapp that allows users to view a video podcast. At present, the user can select whether they would like low or high bandwidth videos depending on whether they are connected via 3G or Wifi.

Is there any way that a webapp could determine this? I know of one way that could use the IP of the device to determine if it's on a network such as AT&T but to find out what their, and every other worldwide carrier's IP range, is something that just isn't feasible.

Is there a way PHP, Javascript - anything - could determine if the iPhone is connected via 3G or Wifi? I was hoping that the iPhone may use a slightly different browser agent string or something similar.


回答1:


You probably don't care about 3G vs WiFi as much as you do about bandwidth/roundtrip time.

I wonder if you can achieve this by not detecting 3G vs WiFi but by computing round-trip time using a browser script and using that to determine the fidelity of the user experience.



来源:https://stackoverflow.com/questions/1579795/web-based-method-to-determine-if-an-iphone-is-connected-via-3g-or-wifi

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