开发者

Obtaining wifi name in iOS

I'm developing an app for Cydia. Is there a way to get the name of actual connected wifi network?

There seems to be a way with the Apple SDK, any ideas?

This is my action:

-(IBAction)addCurrent:(id)sender {
if ([[objc_getClass("SBWiFiManager") sharedInstance] currentNetworkName] != @"") {
        NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithContentsOfFile:pathFile];
        NSMutableArray *networks = [dict objectForKey:@"Networks"];
        [networks addObject:[[objc_getClass("SBWiFiManager") sharedInstance] currentNetworkName]];
        [dict setObject:networks forKey:@"Networks"];
        [dict writeToFile:pathFile atomically: YES];
        [dict release];
}

When 开发者_运维百科I click the button connected to the action, does not add anything to the plist file


This will require a jailbroken device:

[[objc_getClass("SBWiFiManager") sharedInstance] currentNetworkName]


You can use my 3rd party library for this, it uses only Public API: https://github.com/Krivoblotsky/SSIDObserver

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜