1 Reply
      Latest reply: Sep 13, 2017 11:25 PM by tcsw RSS
      xinxing Level 1 Level 1 (0 points)

        My question is written in the code annotation,thanks.

         

        [NEHotspotHelper registerWithOptions:options
                                           queue:dispatch_get_global_queue(0, 0)
                                         handler:^(NEHotspotHelperCommand * _Nonnull cmd) {
           
            if (cmd.commandType == kNEHotspotHelperCommandTypeFilterScanList) {
                NSMutableArray * markList = [NSMutableArray array];
                for (NEHotspotNetwork *network in cmd.networkList) {
                    if ([self isSupportNetwork:network]) {
                        [network setConfidence:kNEHotspotHelperConfidenceHigh];
                        [markList addObject:network];
                    } else {
                        //Question 1: if annotates and using the setNetworkList: method, Wi-Fi Settings will mark the network, but how to Clear the markup?
                        //[network setConfidence:kNEHotspotHelperConfidenceNone];
                        //[markList addObject:network];
                    }
                }
               
                NEHotspotHelperResponse * response = [cmd createResponse:kNEHotspotHelperResultSuccess];
                [response setNetworkList:markList];
                [response deliver];
            } else if (cmd.commandType == kNEHotspotHelperCommandTypeEvaluate) {
                NEHotspotNetwork *cmdNetwork = cmd.network;
                if ([self isSupportNetwork:cmd.network]) {
                    [cmdNetwork setConfidence:kNEHotspotHelperConfidenceHigh];
                } else {
                    [cmdNetwork setConfidence:kNEHotspotHelperConfidenceNone];
                }
                NEHotspotHelperResponse *response = [cmd createResponse:kNEHotspotHelperResultSuccess];
                [response setNetwork:cmdNetwork];
                [response deliver];
            } else {
                //Question 2: if not creat response call deliver, will cause WiFi connection 45 seconds delay?
                //Question 3: if not set network, will cause WiFi connection 45 seconds delay?
                //Question 3: if not set network, will cause WiFi connection 45 seconds delay?
                NEHotspotHelperResponse *response = [cmd createResponse:kNEHotspotHelperResultSuccess];
            //            if (cmd.network) {
            //                [response setNetwork:cmd.network];
            //            }
                [response deliver];
            }
        }];
        

         

        When the hot spot assistant app is closed, connect to a hot spot, if you enter the kNEHotspotHelperCommandTypeMaintain state, the status bar of the WiFi icon will not show, delay 45 seconds after the system started by the app, then the status bar will show WiFi icon. The Is there any way to avoid this situation?