1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

iOS Question iOS 13 SSID and BSSID Problem

Discussion in 'iOS Questions' started by tzfpg, Aug 8, 2019.

  1. tzfpg

    tzfpg Member Licensed 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.


    Code:
    #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.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    simplypats likes this.
  3. simplypats

    simplypats Member Licensed 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.)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice