user1581203
user1581203

Reputation: 43

How to connect to wifi

Can it be done? Opening the wifi settings is possible, but I dont know how to connect to a specific wifi network.

this code:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=WIFI"]];

opens the iPhone wifi settings dialog. Is there any way to compose the URL name? For example "prefs:root="WIFI&path=wifi_name"...

Upvotes: 4

Views: 6599

Answers (2)

Popeye
Popeye

Reputation: 12093

This is possible inside an app, but I believe it is not allowed by Apple guidelines. You should be detecting if there is a networking connection either via WWAN or WiFi or if you can connect to a specific host via a URL. Please see Apple Reachability code for the full implementation for the Reachability code produced by Apple. So this is already done for you.

Upvotes: 2

dandan78
dandan78

Reputation: 13864

I wouldn't expect this to be possible because of the security risks invovled. Imagine an app that messes with your WiFi settings without your knowledge and permission.

Upvotes: 0

Related Questions