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

All scan functions can not run well in android and ios

idrunk opened this issue · comments

commented

In android that called fail and got nothing;
In ios that called fail and got "Not supported".

And this is my testing code in my project.
let WifiWizard2 = require('WifiWizard2') WifiWizard2.getConnectedBSSID((data) => { console.log('getConnectedBSSID 1', data) }, (data) => { console.log('getConnectedBSSID 0', data) }) WifiWizard2.getConnectedBSSIDAsync().then((data) => { console.log('getConnectedSSIDAsync 1', data) }).catch((data) => { console.log('getConnectedSSIDAsync 0', data) }) WifiWizard2.scan((data) => { console.log('scan 1', data) }, (data) => { console.log('scan 0', data) }); (async () => { try { let data = await WifiWizard2.scanAsync() console.log('scanAsync 1', data) } catch (e) { console.log('scanAsync 0', 0) } })() WifiWizard2.listNetworks((data) => { console.log('listNetworks 1', data) }, (data) => { console.log('listNetworks 0', data) }) WifiWizard2.startScan((data) => { console.log('startScan 1', data, WifiWizard2.startScanAsync(), WifiWizard2.getScanResults((data2) => { console.log('getScanResults 1', data2) }, (data2) => { console.log('getScanResults 0', data2) })) }, (data) => { console.log('startScan 0', data) })

commented

@beaubrewer Thank you! Now it run well in android but why is LOCATION not wifi about permission.
And still can not run well in ios, do you try it in ios?

I have not tried it with an iOS build. I read somewhere that iOS doesn't provide casual WiFi scanning.
Here's an interesting article: https://developer.apple.com/library/content/qa/qa1942/_index.html

Hope that helps.

commented

@beaubrewer Ok, i'm a hybrid programer, i can't resolve the pure ios's problem, but still thank you!:smile:

@Drunker please try using the 3.0.0 branch which has the permission request handling built-in to it, you can find that branch here:
https://github.com/tripflex/WifiWizard2/tree/3.0.0

It's a completely different README so make sure to read through it to get an understanding of it, but you can either call the JS helper function to request perms, or when you call a JS helper function that requires that permission it will automatically request it

Unfortunately I do not have an iPhone so I don't really have any way of testing the iOS related stuff

There's already an open issue related to the iOS scan so i'm closing this ticket for now
#6