Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CaptiveNetwork : CNSetSupportedSSIDs usage

I tried to use CaptiveNetwork in order to replace the web sheet that for user authentication with the network. The method is CNSetSupportedSSIDs.

I have tried to add this method in AppDelegate of my app, but when I want to use a hotspot with the SSID that I have registred with the method above, nothing happend. The web sheet not appear, but my app is not opened.

This is my code :

CFStringRef ssids[2] = { CFSTR("Wifi 1"), CFSTR("Wifi 2") };
CFArrayRef arr_ssids = CFArrayCreate(NULL, (const void **)ssids, 2, &kCFTypeArrayCallBacks);

if( CNSetSupportedSSIDs((CFArrayRef)array))
{
    NSLog(@"Successfully registered supported network SSIDs");
}
else
{
    NSLog(@"Error: Failed to register supported network SSIDs");
}
CFRelease(arr_ssids);

PS : I have also added an URL scheme to my app.

Thanks for your answers !

like image 923
malinois Avatar asked Nov 23 '11 22:11

malinois


2 Answers

I have submitted a bug to apple and they answer that it will not pop up our app.

like image 125
getfile1 Avatar answered Nov 14 '22 23:11

getfile1


It seems this is not a complete implementation by Apple. You need to have valid 'entitlements' to use their system library. See this handy post explaining it some more:

http://kalapun.com/blog/2013/02/11/reverse-engineering-ios-app/

like image 33
axello Avatar answered Nov 14 '22 22:11

axello