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

Android 8 will fail when the phone is the first time(new) connect to the wifi network from the app directly. #124

Open sifeng86 opened 3 years ago

sifeng86 commented 3 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

Android 10 can change the wifi connection from the app directly(pop up a alert box and let the user click connect).

Android 8 will fail when the phone is the first time(new) connect to the wifi network from the app directly. But when a user connect the wifi network from wifi setting and disconnected (not new). The second time, when user connect the wifi network from app directly, it will success.

Two android 8 phone were tested.

*first time mean your phone, never connected to the wifi or you ever clicked the "forget the network" in wifi setting.

Steps to Reproduce

  1. Android 8 phone, go to wifi setting and forgot the target network(if connected before, make sure it is new in setting)
  2. CMD: cordova plugin add https://github.com/tripflex/WifiWizard2#master
  3. connect the phone to laptop.
  4. CMD: cordova run android
  5. using console in the chrome://inspect
  6. in the console tab: CMD: WifiWizard2.connect('abc', true, false, 'WPA');
  7. return promises -> time out or return "ERROR_UPDATING_NETWORK".
  8. the android 8 phone not changing the the wifi.

Expected behavior: [What you expect to happen]

Can connect to a target wifi from app directly.

Actual behavior: [What actually happens]

Failed to change the wifi from app directly if the wifi network is new to the phone

Reproduces how often: [What percentage of the time does it reproduce?]

100%

Versions

latest version from github master branch. Android 8 : Asus Zenfone 4 and LG Nexus 5

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.