开发者

How to change connection from 3G to wi-fi programmatically using iPhone SDK?

开发者 https://www.devze.com 2023-01-12 21:14 出处:网络
Lets consider that I am connected to internet through3G in my App. When a wi-fi hot spot seems to be appearing, can I programmatically 开发者_开发知识库switch to the wi-fi. Is this vice-versa conditio

Lets consider that I am connected to internet through 3G in my App. When a wi-fi hot spot seems to be appearing, can I programmatically 开发者_开发知识库switch to the wi-fi. Is this vice-versa condition possible?


iOS does this automatically by itself!

If no known WiFi network is found, it uses cellular data. If it finds a known WiFi-network, it connects to and uses that network instead.

If any WiFi-network is found, and your application requests access to the internet, iOS (usually) automatically presents an alertView and lets the user log in to a WiFi-network. If the user does not log into a WiFi-network, it stays on the 3G-network. When iOS 7 comes, iOS may connect to Hotspot 2.0 networks automatically as well.

Apple keeps individual apps on a tight leash, and so they do not let apps control things like this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号