tripflex / WifiWizard2

A Cordova plugin for managing Wifi networks (new version of WiFiWizard) - Latest is version 3+

Home Page:https://www.npmjs.com/package/cordova-plugin-wifiwizard2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If Android 9+, we need to check for ACCESS_FINE_LOCATION permissions

arsenal942 opened this issue · comments

Prerequisites

Check all boxes if you have done the following:

Issue type

Select all that apply

  • Bug
  • Enhancement
  • Task
  • Question
  • Other

Description

In Android 9, there are permission restrictions on the getConnectionInfo method which returns a WiFiInfo object that describes the current WiFi connection. To call this, you require the following:

  • ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION
  • ACCESS_WIFI_STATE

Steps to Reproduce

  1. Try to call any method that calls getConnectionInfo

Expected behavior:
I expect the success callback to fire

Actual behavior:
The error callback fires

Reproduces how often:
100% of the time

Versions

Affects the current version and only Android devices that are running Android 9+

@tripflex I already have the fix in a fork so I'll submit a PR.

I had to urgently fix this for my application so feel free to clean it up a bit for your own needs.