tripflex / WifiWizard2

A Cordova plugin for managing Wifi networks (new version of WiFiWizard) - Latest is version 3+

Home Page:https://www.npmjs.com/package/cordova-plugin-wifiwizard2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iOSDisconnectNetwork() does not actually disconnect at all

zabojad opened this issue · comments

Prerequisites

Check all boxes if you have done the following:

Issue type

Select all that apply

  • Bug
  • Enhancement
  • Task
  • Question
  • Other

Description

I'm testing this plugin on an iPhone SE with iOS 13.2.3. Here are my observations:

        WifiWizard2.getConnectedSSID()
            .then(
                function(v) {
                    console.log('GOT SSID: '+v);
                    if (v) {
                        console.log('disconnecting from: '+v);
                        WifiWizard2
                            .iOSDisconnectNetwork(v)
                            .then(
                                function(){
                                    setTimeout(app.refreshSSID,1000);
                                }
                            );
                    }
                    else {
                        let ssid = view.getSSIDInput();
                        console.log('connecting to: '+ssid);
                        WifiWizard2
                            .iOSConnectNetwork(ssid, false)
                            .then(
                                function(){
                                    setTimeout(app.refreshSSID,1000);
                                }
                            );
                    }
                }
            )
            .catch(
                function(e){
                    console.error(e);
                    alert("can't get current SSID: "+e.message);
                }
            );

=> WifiWizard2.iOSDisconnectNetwork(v) enters in its then block but it doesn't disconnect the device from the wifi hotspot.

Steps to Reproduce

  1. Use the code above and run it.

Expected behavior:

When entering the then blowk of the iOSDisconnectNetwork operation, the device should be disconnected from its wifi hotspot.

Actual behavior:

Nothing seems to happen when it should actually disconnect from the wifi.

Reproduces how often: 100% of the time

Versions

$ cordova -v
9.0.0 (cordova-lib@9.0.1)

$ cordova platform list
Installed platforms:
  ios 5.1.1
Available platforms: 
  android ^8.0.0
  browser ^6.0.0
  electron ^1.0.0
  osx ^5.0.0
  windows ^7.0.0

$ cordova plugin list
com.wizpanda.cordova.guided-access 0.0.1 "cordova-ios-guided-access"
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-battery-status 2.0.5 "Battery"
cordova-plugin-brightness 0.1.5 "Brightness"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-device-name 1.3.5 "Device-Name"
cordova-plugin-exit 1.0.3 "Exit"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-geolocation 4.0.2 "Geolocation"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-plugin-wkwebview-engine 1.2.1 "Cordova WKWebView Engine"
es6-promise-plugin 4.1.0 "Promise"
phonegap-plugin-barcodescanner 8.1.0 "BarcodeScanner"
wifiwizard2 3.1.1 "WifiWizard2"

Additional Information

n/a

I think that it probably comes from the fact that I did not connect to that hotspot with the iOSConnectNetwork method...