iOS Question WIFI RunMethod("getSSIDs",null) no function

francisco duran

Member
Licensed User
Hi, need your help. I can´t obtain info fo all SSIDs; i am using:

'-----
Dim no As NativeObject = Me
Dim ssids As List = no.RunMethod("getSSIDs", Null)
Log(ssids)
'-------------

I am work with IPHONE 12, and return empty list.

Thanks
 

francisco duran

Member
Licensed User
Hi, i use :

'------------------
#Entitlement: <key>com.apple.developer.networking.wifi-info</key><true/>

'---------

AND

#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;
}

Bye
 

francisco duran

Member
Licensed User
Hi, thanks, sorry by
B4X:
  .

This is the code that use, always returns an empty list, no error appears, only empty list.
I am using iphone 12
'----------------------------------
[code]

Sub wifiscan_Scan()
    
    Dim res() As String
    Dim no As NativeObject = Me
    Dim ssids As List = no.RunMethod("getSSIDs", Null)
   Log(ssids)
    TableView1.Clear

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
 
Top