简体   繁体   中英

Hotspot plugin scanWifi() is not working in Android ionic cordova

I'm facing an issue while scanning nearest wifi. I'm using ionic Cordova framework. I have used a scanWifi method of Hotspot plugin to scan wifi list. I have referred to the following link: https://ionicframework.com/docs/native/hotspot/

My code is:

import { Hotspot, HotspotNetwork } from '@ionic-native/hotspot';

this.hotspot.scanWifi().then((networks: Array<HotspotNetwork>) => {
   this.availableWifiList = networks;
});

When app trying to scan the nearest wifi it returns an empty array of wifi list. But it's working on other Android devices.

The issue is reproduce in the following android device only for me.

Micromax: Model Number: Micromax Q452 Android Version: 7.0 Android Security Patch Level: May 5, 2017

Also, it is working on other Android device having the same Android version.

Most probably is an issue related to permissions. Remove/reinstall the app and grant permissions again. It should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM