Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.RootPanel.LoadLayout("1")
Nav.ShowPage(Page1)
Dim no As NativeObject = Me
Dim ssids As List = no.RunMethod("getSSIDs", Null)
Log(ssids)
End Sub
#If OBJC
#import <SystemConfiguration/CaptiveNetwork.h>
- (NSMutableArray*)getSSIDs {
NSMutableArray* res = [NSMutableArray new];
NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
for (NSString *ifnam in ifs) {
NSDictionary *info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
if (info[@"SSID"]) {
B4IMap* map = [B4IMap new];
map.dict = info;
[res addObject:map];
}
}
return res;
}
#End If
It will return a list of maps. Each map holds the information of a network.
As far as I know, in iOS, it is not possible to scan a network and obtain information of available access-points. You can only get information from the access-point your device is connected to.
I'd love to be corrected since this is a feature I'd love to see implemented.
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.RootPanel.LoadLayout("1")
Nav.ShowPage(Page1)
Dim no As NativeObject = Me
Dim ssids As List = no.RunMethod("getSSIDs", Null)
Log(ssids)
End Sub
#If OBJC
#import <SystemConfiguration/CaptiveNetwork.h>
- (NSMutableArray*)getSSIDs {
NSMutableArray* res = [NSMutableArray new];
NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
for (NSString *ifnam in ifs) {
NSDictionary *info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
if (info[@"SSID"]) {
B4IMap* map = [B4IMap new];
map.dict = info;
[res addObject:map];
}
}
return res;
}
#End If
It will return a list of maps. Each map holds the information of a network.
So, no way to detect a "unknown" wifi? I don't mean the mac address, I only mean the public wifi name. That is a bit strange as from Iphone / Ipad we can always see the available (visible) wifi hotspots when we try to connect to.
I see this is an old thread, but wanted to know if you can connect to a known AP, so proprietorially can you say connect to "X" if you know X is there....