RK-
RK-

Reputation: 12211

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

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?

Upvotes: 2

Views: 1208

Answers (1)

Emil
Emil

Reputation: 7256

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.

Upvotes: 13

Related Questions