tripflex / WifiWizard2

A Cordova plugin for managing Wifi networks (new version of WiFiWizard) - Latest is version 3+
https://www.npmjs.com/package/cordova-plugin-wifiwizard2
Apache License 2.0
123 stars 146 forks source link

Receive `null` from iOSConnectNetwork() when Cellular is enabled and Network is Saved #133

Open allidoisace opened 2 years ago

allidoisace commented 2 years ago

<!--

Have you read the plugins' Code of Conduct? By creating an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/tripflex/wifiwizard2/blob/master/CODE_OF_CONDUCT.md

-->

Prerequisites

Check all boxes if you have done the following:

Issue type

Select all that apply

Description

Device: iPad Pro 12.9 in. Version: 15.4.1 Conditions: Cellular data is enabled, but currently connected to WiFi (House WiFi for example). Desired Network to connect to is saved under "My Networks" in the WiFi Settings.

When initiating await WifiWizard2.iOSConnectNetwork(ssid, ssidPassword);, the Promise returns almost instantly with a caught error of null and a prompt is displayed on the iPad: "Unable to join the network '...' ".

Steps to Reproduce

  1. Turn on Cellar Data (wait like 30s after)
  2. Connect to WiFi
  3. Open app and initiate the iOSConnectNetwork() call to some other network.

Expected behavior: Connects to WiFi as defined by the ssid and ssidPassword

Actual behavior: Returns null from Promise and displays prompt on the iOS screen "Unable to join the network '...' " immediately.

Reproduces how often: 95%. The 5% it works is when switching cellular on and off.

Versions

iOS: 15.4.1 WiFiWizard2: 3.1.1 Ionic: 6.0.8

Additional Information

development.plist

        <key>com.apple.developer.networking.HotspotConfiguration</key>
    <true/>
allidoisace commented 2 years ago

I changed the title because I believe this issue is actually being caused by the desired network already being saved under "My Networks".

EYALIN commented 1 year ago

@allidoisace it has been fixed in my forked repo: https://github.com/EYALIN/community-cordova-plugin-wifi-wizard

you can install it as an npm package: cordova plugin add community-cordova-plugin-wifi-wizard --save