user1934297
user1934297

Reputation: 1

how to provide specific wifi credentials when application is launched in ios?

how I can start a system service for example wifi, when an application is launched on ios? my application just run in one specific wifi connection only....... i am using Reachability and also cheched wifi connections but i want to provide specific custom wifi credentials.

Reachability* wifiReach = [Reachability reachabilityForLocalWiFi];
NetworkStatus netStatus = [wifiReach currentReachabilityStatus];
if (netStatus!=ReachableViaWiFi){

   UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"No WIFI available!", @"AlertView") message:NSLocalizedString(@"You have no wifi connection available. Please connect to a WIFI network.", @"AlertView")delegate:self cancelButtonTitle:nil otherButtonTitles:@"Ok", nil];
    [alertView show];
}else{

    printf("\n wifi");

}

Upvotes: 0

Views: 116

Answers (1)

Sylvain Guillopé
Sylvain Guillopé

Reputation: 1367

It's not possible to establish a WiFi connection from within your app (at least not without using private APIs or a jailbroken device). It can only be configured by the user from the iOS Settings.

If you're developing an Enterprise app usually devices can have their WiFi pre-configured either by using Apple Configurator or a MDM (Mobile Device Management) software.

Upvotes: 2

Related Questions