capacitor-plugins icon indicating copy to clipboard operation
capacitor-plugins copied to clipboard

[Bug]: networkStatusChange is triggering the event when changing the wifi frequency

Open Magrelinho opened this issue 1 year ago • 1 comments

Capacitor Version

Latest Dependencies:

@capacitor/cli: 6.1.0 @capacitor/core: 6.1.0 @capacitor/android: 6.1.0 @capacitor/ios: 6.1.0

Installed Dependencies:

@capacitor/ios: not installed @capacitor/cli: 6.1.0 @capacitor/android: 6.1.0 @capacitor/core: 6.1.0

Other API Details

Angular CLI: 18.0.4
Node: 18.20.2
Package Manager: npm 10.7.0
OS: win32 x64

Angular: 18.0.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1800.4
@angular-devkit/build-angular   18.0.4
@angular-devkit/core            18.0.4
@angular-devkit/schematics      18.0.4
@angular/cli                    18.0.4
@schematics/angular             18.0.4
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.7

Platforms Affected

  • [ ] iOS
  • [X] Android
  • [ ] Web

Current Behavior

networkStatusChange is triggering the event when changing the wifi frequency this.networkListener = Network.addListener('networkStatusChange', (status: { connected: boolean }) => { console.log(Network alterado: ${status.connected ? 'Online' : 'Offline'}); });

Expected Behavior

Only trigger the event when changing the connection type

Project Reproduction

https://github.com/Magrelinho/networkStatusChange

Additional Information

Screenshot_20240619_133739 Screenshot_20240619_133840

Magrelinho avatar Jun 19 '24 16:06 Magrelinho

The networkStatusChange listener is not triggering when network goes from online to offline or vice versa on Android. iOS and web work as expected.

Scooby27 avatar Oct 14 '24 03:10 Scooby27