iOS Question iOS 13 SSID and BSSID Problem

tzfpg

Active Member
Licensed User
Longtime User
Hi,

I received email from Apple that mention after iOS 13 release then CNCopyCurrentNetworkInfo API will no longer return valid Wi-Fi SSID and BSSID information.

In Apple email, they got mention about NEHotspotConfiguration to configure the current Wi-Fi network, and apps that have obtained permission to access user location through Location Services.


B4X:
#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);
 // ssid = @"none";
  if (info[@"SSID"]) {
  ssid = info[@"SSID"];
  }
  }
  return ssid;
}

- (NSString *)currentWifiBSSID {
  // Does not work on the simulator.
  NSString *bssid = nil;
  NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
  for (NSString *ifnam in ifs) {
  NSDictionary *info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
 // ssid = @"none";
  NSLog(@"info:%@",info);
  if (info[@"BSSID"]) {
  bssid = info[@"BSSID"];
  }
  }
  return bssid;
}
#end if

After iOS 13 release, how can we get this info?

Thank you.
 

simplypats

Member
Licensed User
Longtime User
Many Thanks for this, followed these recommendations and this seems to have solved the issue of obtaining SSID on iOS 13 (beta build downloaded today.)
 
Upvote 0
Top