question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

All scan functions can not run well in android and ios

See original GitHub issue

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) })

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
beaubrewercommented, Mar 7, 2018

You need to request location permission for the scan to return results. I worked on an application last night targeted for Android and the scan returned results without any issues.

One issue I did find was the missing requestPermission method mentioned in the docs. This doesn’t seem to be present in the Cordova plugin. I ended up using Ionic-Native Permissions (https://ionicframework.com/docs/native/android-permissions) to request “ACCESS_FINE_LOCATION” and everything works as expected.

On Mar 6, 2018 7:47 PM, “drunker” notifications@github.com wrote:

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) })

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tripflex/WifiWizard2/issues/16, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPNATSTPVX21woAhiI0T2HtK_ySQMbqks5tb0o5gaJpZM4SfxuT .

0reactions
tripflexcommented, Apr 12, 2018

@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 https://github.com/tripflex/WifiWizard2/issues/6

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to scan QR Code via Camera - Apple Developer
After the update from iOS 13 to iOS 14, the functionality to scan bar code via the Camera app stopped working. A border...
Read more >
How to Run Diagnostics on Your iPhone or Android Phone
The app offers a lot of flexibility to run the various tests. You can choose Quick Scan to check key features or tap...
Read more >
Security tips - Android Developers
As a workaround, if your app is running on these devices, it must confirm that WebView objects display only trusted content. To make...
Read more >
The 4 Best Mobile Scanning Apps of 2022
Adobe Scan (for Android and iOS) is great at capturing the sort of documents life throws at you every once in a while—stuff...
Read more >
How to Scan a QR Code on Android and iOS | Digital Trends
1. Open up the Camera app. 2. If you don't see the QR code icon in your Control Center on iOS, then simply...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found