Closed ghost closed 4 years ago
Problem solved: You have to enable GPS in your mobile settings and give permissions to your app (in the app settings). If this hasn't been handled before, wifiWizard.scan() will return the error, but otherwise it will work.
What? Why? Does the App require GPS to work? In all android versions?
What? Why? Does the App require GPS to work? In all android versions?
In basic Android development (done with Java), there are also methods to scan for access points and to use them, it's required by Android to enable your Location Services and permit your app to use them, as seen in this official article: https://developer.android.com/guide/topics/connectivity/wifi-scan
<!--
Have you read the plugins' Code of Conduct? By creating an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/tripflex/wifiwizard2/blob/master/CODE_OF_CONDUCT.md
-->
Prerequisites
Check all boxes if you have done the following:
Issue type
Select all that apply
Description
Made an Ionic-React Project and added Capacitor via CLI, installed the plugin following the docs instructions of the plugin (https://ionicframework.com/docs/native/wifi-wizard-2), imported WifiWizard into my TSX file, created a new const instance of WifiWizard2, used the function "let results = await wifiWizard2.scan();", added android to capacitor and tested it in Android Studio with an Emulator. The console showed up an error: "Uncaught (in promise) SCAN_FAILED"
Steps to Reproduce
Expected behavior: return the results of the WIFI scan
Actual behavior: returns an error "Uncaught (in promise) SCAN_FAILED"
Reproduces how often: everytime
Versions
Ionic CLI: 6.11.0, Capacitor CLI: 2.4.0, OS: Windows 10, Android Studio Emulator uses API 30