Learn how to deploy NEHotspotHelper

Asked 2 years ago, Updated 2 years ago, 69 views

Thank you for your help.
http://qiita.com/naokits/items/aa16e1553880c7ddbfbf
Using the above page as a reference, I made a Network Extension authorization inquiry and received permission to see the Network Extension in the Entitlement section as shown in the image.

Apple Developer program

However, when I executed the following code, nothing came into the interfaces.

 func printRetrievedWifiNetwork(){
    let interfaces = NEHotspotHelper.supportedNetworkInterfaces()
    print("---\(interfaces)")// I got Apple's permission, but nothing came in here

    for interface interfaces as![NEHotspotNetwork] {
        print("---\(interfaces)")
        lettsid = interface.ssid
        let bssid = interface.bssid
        let secure = interface.isSecure
        let autoJoin = interface.didAutoJoin
        let signalStrength = interface.signalStrength

        print("ssid:\(ssid)")
        print("bssid:\(bssid)")
        print("secure:\(secure)")
        print("autoJoined:\(autoJoined)")
        print("signalStrength:\(signalStrength)")
    }
}

Could you tell me how to deploy NEHotspotHelper?

ios xcode swift3

2022-09-30 17:40

1 Answers

The following NEHotspotHelper class methods must be run:

 func register(options:[String:NSObject]?=nil,queue:DispatchQueue,handler:@escaping NEHotspotHelperHandler) ->Bool

After running this method, once you put your app in the background and go to the Wi-Fi screen of the configuration application, Handler will reject the results, so you can get the list for the first time.

Reference
http://dev.classmethod.jp/smartphone/ios-nehotspothelper/
https://mobiarch.wordpress.com/2016/11/02/working-with-nehotspothelper/


2022-09-30 17:40

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.