Post

Replies

Boosts

Views

Activity

Connect WPA2 Enterprise wifi programmatically
I am trying to connect wpa2 enterprise wifi using iPhone app programmatically.before that I tried connecting to that wifi manually:From Settings in iPhone deviceUsed these three parameters SSID, Username, passwordAfter that it ask to trust the certificate and trusting the certificate, the wifi get connect, Done!Now I am trying to connect wifi programmatically using following code:NEHotspotEAPSettings *settings = [[NEHotspotEAPSettings alloc]init]; settings.password = self.password.text; settings.username = self.username.text; settings.supportedEAPTypes = [NSArray arrayWithObjects:[NSNumber numberWithInteger:NEHotspotConfigurationEAPTypeEAPPEAP], nil]; NEHotspotConfiguration *configuration = [[NEHotspotConfiguration alloc]initWithSSID:self.ssid.text eapSettings:settings]; [[NEHotspotConfigurationManager sharedManager]applyConfiguration:configuration completionHandler:^(NSError * _Nullable error) { if (error) { NSLog(@"Error: %@",error.localizedDescription); } else { NSLog(@“Connected”); } }];but this code gives an errorInvalid EAP settings : NEHotspotConfiguration EAP settings must have either trusted server certificates or trusted server names configuredSince I don’t have any trusted server certificate or trusted server name. What should I set in the blow property of NEHotspotEAPSettings (passing nil also gives me same error)settings.trustedServerNamesPlease help to solve this. Thanks!
6
0
2.4k
May ’22