NEHotspotHelper causes WiFi connection 45 seconds delay and can not clear WiFi tag problem

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?

Replies

My Experience.

Question 1, it cannot.

Question 2, if you do nothing on next state(Authenticate), maybe you can set setConfidence:kNEHotspotHelperConfidenceNone, it works for me.