apache / apache/cordova-plugin-network-information

Network type not updating during runtime

Open
#95 0 comments 2 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

### What is expected to happen?

When the network type changes the `type`-property should update accordingly.

### What does actually happen?

When the `type`-property changes on app start and resumption only.

## Information

Plugin Version 2.0.2

### Command or Code

```
setInterval(
() => console.warn(navigator.connection.type),
500);
```

### Environment, Platform, Device

Android 8 & 9. (Device & Emulator)

### Version information

```
Ionic:

Ionic CLI : 5.4.4 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.9
@ionic/app-scripts : 3.2.4

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.1.0, ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-webview 2.5.2, (and 18 other plugins)

Utility:

cordova-res : 0.6.0 (update available: 0.8.1)
native-run : 0.2.9

System:

Android SDK Tools : 26.1.1 (/Users/xxx/Library/Android/sdk)
ios-deploy : 1.9.4
ios-sim : 8.0.2
NodeJS : v12.6.0 (/usr/local/Cellar/node/12.6.0/bin/node)
npm : 6.10.2
OS : macOS Catalina
Xcode : Xcode 11.1 Build version 11A1027
```

## 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 supplied setInterval example on Android 8 or 9 and changing the network connection during runtime. Inspect the plugin’s Android handling of network changes and the navigator.connection.type value. Done means the type property updates while the app remains running, not only on startup or resumption.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
mobile-dev, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.