apache / cordova-plugin-network-information

Apache Cordova Network Information Plugin
https://cordova.apache.org/
Apache License 2.0
465 stars 321 forks source link

network.connection.type is always unkown on iOS 13.2.2 #97

Open manjunathgudisi opened 4 years ago

manjunathgudisi commented 4 years ago

Bug Report

Problem

network.connection.type is always unkown though I had connected to wifi and mobile data connection.

What is expected to happen?

network.connection.type = "WIFI"

What does actually happen?

network.connection.type = "unkonwn"

Information

I followed this documentation: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-network-information/index.html

Environment, Platform, Device

iPhone XR running on iOS 13.2.2

Version information

Cordova version: 9.0.0 (cordova-lib@9.0.1) node version: v12.8.1 npm version: 6.13.0

ordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport" cordova-plugin-barcodescanner 0.7.4 "BarcodeScanner" cordova-plugin-battery-status 2.0.3 "Battery" cordova-plugin-camera 4.1.0 "Camera" cordova-plugin-compat 1.2.0 "Compat" cordova-plugin-device 2.0.3 "Device" cordova-plugin-dialogs 2.0.2 "Notification" cordova-plugin-file 6.0.2 "File" cordova-plugin-file-transfer 1.7.1 "File Transfer" cordova-plugin-geolocation 4.0.2 "Geolocation" cordova-plugin-media-capture 3.0.3 "Capture" cordova-plugin-network-information 2.0.2 "Network Information" cordova-plugin-splashscreen 5.0.3 "Splashscreen" cordova-plugin-vibration 3.1.1 "Vibration" cordova-plugin-whitelist 1.3.3 "Whitelist"

Checklist

manjunathgudisi commented 4 years ago
Screen Shot 2019-11-17 at 10 47 50 AM

This is how it looks like when I debug the app.

mkurzweil commented 4 years ago

same situation here :(

Ross-Rawlins commented 4 years ago

Just came across this as well

timbru31 commented 4 years ago

Is anyone of you Apple to test the iOS 13.3 Beta? Does the issue still persist? Also, is, e.g., iOS 13.2 or lower affected, too?

I could imagine that Apple changed the API - or broke it (temporarily).

manjunathgudisi commented 4 years ago

I noticed this behaviour

Ross-Rawlins commented 4 years ago

My Connection type only returns for WIFI, all the others come back as none

PieterVanPoyer commented 4 years ago

I noticed this post: https://programmer.help/blogs/new-features-of-cncopycurrent-network-info-in-ios-13.html IMO apple changed the behaviour to protect user privacy.

It seems only some apps can obtain more information of the network. image

I think the plugin uses an older api (the Objective C Reachablity - api) than mentioned in the post, but the rules will probably remain the same.

jacobg commented 4 years ago

Running in iOS simulator, the navigator.connection.type starts off with value wifi. If I turn off the host wifi, then the type becomes none as expected. But when I turn wifi back on, the type still remains none forever. It never updates back to wifi.