Ionic-native/network - Type Always "unknown"


#1

I’m using the ionic-native/network plugin (cordova-plugin-network-information). During startup and resume I want to check network status and adjust my startup routine based on network status. Unfortunately the type property is always “unknown”. Airplane mode or other network adjustments don’t impact this type.

Has anyone else run into this? I am running on an Android device, and I’m executing after platform.ready().

Ionic Native Version:

"@ionic-native/core": "^3.10.3"
"@ionic-native/network": "^3.10.3"

Plugin Version:

cordova-plugin-network-information 1.3.3 "Network Information"

Android OS:

5.1

global packages:

@ionic/cli-utils : 1.2.0
Cordova CLI      : 6.5.0
Ionic CLI        : 3.2.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.2.1
@ionic/cli-plugin-ionic-angular : 1.2.0
Cordova Platforms               : android 6.1.2 ios 4.3.1
Ionic Framework                 : ionic-angular 3.3.0

#2

For reference, I believe my issue was that I was using code-push to get new versions of the app to my device. When I installed this new plugin I needed to do a fresh ionic cordova run android to get a new version of the app, plugins and permissions on to the device. Seems like it works well now!