tripflex / WifiWizard2

A Cordova plugin for managing Wifi networks (new version of WiFiWizard) - Latest is version 3+
https://www.npmjs.com/package/cordova-plugin-wifiwizard2
Apache License 2.0
123 stars 146 forks source link

#71 Prompt to enable location services if device is Android 9+ #72

Closed arsenal942 closed 5 years ago

arsenal942 commented 5 years ago

Description of the Change

Alternate Designs

n/a

Why Should This Be In Core?

Because the plugin breaks for Android 9+ if we don't have it

Benefits

Will enable Android 9+ devices to utilise the getConnectionInfo method. The location services enabled check only fires if Android 9+ which is nice because it doesn't annoy users not on Android 9+

Possible Drawbacks

n/a

Applicable Issues

71

arsenal942 commented 5 years ago

@tripflex Tried and tested this so I will merge it since it's a critical fix. I'd still recommend you have a look over it for cleanup/etc.

tripflex commented 5 years ago

@eugenioghio thanks for reporting this, are you able to provide any kind of logs when this happens? Can you try running adb logcat with the device connected to see what is being output from android logs -- or maybe any logs from your application?

tripflex commented 5 years ago

@arsenal942 from what i can tell -- this is not specific to just Android 9+, but specific to Android 6+ (API 23)

https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id

arsenal942 commented 5 years ago

@tripflex There are some changes that you just have to question and go "Why...."

tripflex commented 5 years ago

@arsenal942 yup .. took me a minute to track that down too as it doesn't appear that they have "docs" online from previous API versions which make it hard as hell to figure out when things changed.

For now i'm switching this to >= 23 and going to push this 3.1.1 update, i added a location branch which adds checking if location is enabled, going to location setting, but going to push that to 3.2.0 release where i can do more research to see what is required to have location enabled

arsenal942 commented 5 years ago

Sounds good to me. I still want a log/some information on the device @eugenioghio is using. I've got three devices all of varying API versions between 24-27 and none had any issues with using this method.

We'll just make it a global rule that any device must have them enabled (even if they don't have to).