Sub Process_Globals
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private NativeMe As NativeObject
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.RootPanel.LoadLayout("1")
NavControl.ShowPage(Page1)
NativeMe = Me
Dim ssid As String = NativeMe.RunMethod("currentWifiSSID", Null).AsString
Log(ssid)
End Sub
#If OBJC
#import <SystemConfiguration/CaptiveNetwork.h>
- (NSString *)currentWifiSSID {
// Does not work on the simulator.
NSString *ssid = nil;
NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
for (NSString *ifnam in ifs) {
NSDictionary *info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
if (info[@"SSID"]) {
ssid = info[@"SSID"];
}
}
return ssid;
}
#end if