【发布时间】:2012-01-31 17:39:47
【问题描述】:
我尝试使用 CaptiveNetwork 来替换用于网络用户身份验证的网页。方法是 CNSetSupportedSSIDs。 我尝试添加列表,但每次打开我的应用程序时,用于用户身份验证的网页仍然不断弹出。 我尝试调试它,我意识到我一直将返回值设为 FALSE。
这是我的代码:
-(void)updateSSIDlist
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"ssidInitStarted" object:nil userInfo:nil];
ATT_Remote_Access_Wifi_ClientAppDelegate *delegate = (ATT_Remote_Access_Wifi_ClientAppDelegate *)[[UIApplication sharedApplication] delegate];
delegate.ssidInitFinished = NO;
Hotspots *h = [Hotspots defaultHotspots];
NSArray *ssids2 = [h uniqueSSIDs];
NSLog(@"ssids we're shoving down into the system config for iOS to leave alone: %@", [ssids2 description]);
bool ok = CNSetSupportedSSIDs((CFArrayRef) ssids2);
if(ok)
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"ssidInitCompleted" object:nil userInfo:nil];
NSLog(@"completed");
}
else
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"ssidInitFailed" object:nil userInfo:nil];
NSLog(@"failed");
}
delegate.ssidInitFinished = YES;
delegate.dbIsBusy = NO;
}
我搜索了很多,但找不到任何正确的示例或文档。 我也尝试了下面的链接示例,但即使这样也重新调整了相同的结果。
感谢任何帮助!谢谢!
【问题讨论】:
标签: iphone