ios – Private Hotspot – Stack Overflow

[ad_1]

I attempted to get private hotspot SSID, BSSID and Password data utilizing following code but it surely returns my wifi data and if i shut wifi than nothing to returns.

  func fetchSSIDInfo() ->  String? {
           if let interfaces = CNCopySupportedInterfaces() {
               for i in 0..<CFArrayGetCount(interfaces){
                   let interfaceName: UnsafeRawPointer = CFArrayGetValueAtIndex(interfaces, i)
                   let rec = unsafeBitCast(interfaceName, to: AnyObject.self)
                   let unsafeInterfaceData = CNCopyCurrentNetworkInfo("(rec)" as CFString)
                  
                   if let unsafeInterfaceData = unsafeInterfaceData as? Dictionary<AnyHashable, Any> {
                       return unsafeInterfaceData["SSID"] as? String
                   }
               }
           }
           return nil
       }

Is there any method to get my private HotSpot SSID, BSSID and Password in iOS?

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *