apache / apache/cordova-plugin-network-information

Android no internet triggering `online` function

Open
#107 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
465
Forks
339
PR merge metrics
No merged PRs in 30d

Description

# Bug Report

## Problem:
On Android, app starts with internet access, move phone into airplane mode and the `online` function triggers when the `offline` function should trigger. This is happening about 50% of the time. After taking phone off airplane mode, I can see `online` function trigger again and then on a 2nd time putting phone into airplane mode do I finally see it go `offline`

### What is expected to happen?
Moving phone into airplane mode should trigger the `offline` function - every time.

### What does actually happen?
On first time putting phone into airplane mode - I see `online` function trigger. After restoring phone and then putting back into airplane mode a 2nd time, the `offline` triggers as its supposed to. Its only happening on the first time.

## Information

Included above.

### Command or Code

Plugin version 2.0.2

### Environment, Platform, Device

Android...its happening on Android 5 through 9. - all my test devices.

### Version information

Plugin Version: 2.0.2

Ionic:
Ionic CLI : 5.4.2 (C:\Users\RPO\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic1 1.0.0
@ionic/v1-toolkit : 1.0.22

Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, (and 30 other plugins)

Utility:
cordova-res : 0.6.0
native-run : 0.2.8

System:
NodeJS : v10.16.3 (C:\Program Files\nodejs\node.exe)
npm : 6.4.0
OS : Windows 7

## Checklist

- [x ] I searched for existing GitHub issues
- [ ] I updated all Cordova tooling to most recent version
- [x ] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the first airplane-mode transition on Android 5–9 with plugin version 2.0.2, focusing on the online and offline function callbacks. Trace how the plugin detects connectivity changes and verify that entering airplane mode emits offline on the first transition and every subsequent transition.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
mobile-dev, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.