CaptiveNetwork : CNSetSupportedSSIDs usage
-
14-04-2021 - |
Question
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 !
Solution
I have submitted a bug to apple and they answer that it will not pop up our app.
OTHER TIPS
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/
In any way, this code contains a type-o. CNSetSupportedSsids should be fitted with arr_ssids in your code snippet here. I don't know what kind of variable 'array' is, but it probably doesn't contain the dat you'd desire.