Issue
I'm new to Ionic and I've been working on a companion app for an IoT device I've developed. The device has an access point and I need to connect my phone to the device in order to send some data to it. So far the solution was the WifiWizard2 plugin for Ionic and a simple command:
this.wifiWizard2.connect("device_access_point", true, "123456789", "WPA");
This works perfectly on my device, however I've noticed that It does not work on Android 10. Attempting to run the code on Android 10 prints "ERROR_ADDING_NETWORK" error. I've been searching for a solution for quite some time now, but it seem that this isn't a common problem. Is there a different way to connect Android 10 to specific wifi networks, or does the new version completely block these kind of requests from the app?
Solution
I figured it out after coming back to this problem. The issue is in the app permissions. In order to use WiFi functionality on newer versions of Android, the app needs location permission.
So the solution is simply adding location permission to the app. You can ask for it from the app, or you can test it by going to your app settings -> permissions -> location and clicking Allow. WifiWizzard should work fine after that.
I think the android allow permission window should be triggered automatically, but on my devices it does not, so I had to ask for them manually.
Answered By - nikvujic
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.