hoerresb / WifiWizard

A Cordova plugin for managing Wifi networks
Apache License 2.0
205 stars 178 forks source link

List Not Refreshing & Not Updating #47

Open stefblokdijk opened 8 years ago

stefblokdijk commented 8 years ago

Hey!

I like the plugin but the problem is that when i try to refresh the list. it refreshes like 1 time and stays the same the whole day. it doenst changes even when i change locations. like it caches the list.

Also the list is very incomplete. There are like 8 networks around me but it only shows 2 sometimes 4 and then 1

hoerresb commented 8 years ago

The list won't refresh automatically. You will have to call WifiWizard.startScan(success, fail); to start scanning for the current wifi networks then WifiWizard.getScanResults([options], listHandler, fail); to get an updated list.

As for the incomplete list, this is the first i've heard of this issue. We use Android wifimanager api and directly return the list of available networks. I will look into this issue a bit more and see if I can find something that might be causing this.

Let me know if this helps at all. Thanks.

hafeyang commented 8 years ago

here is my code

WifiWizard.startScan(function(){ 
    WifiWizard.getScanResults({},function(arr){
      //is this array the latest WiFi list ? it seems not the latest WiFi list sometimes
    }) 
 })

does the callback startScan mean the scanning started or scanning ended?

sathyesh commented 8 years ago

Hi, I am facing the same issue , Can you please tell me the right step to get the updated list?

Thanks, Sathyesh

faizan1990 commented 5 years ago

Hi Sathysh, I have managed to get the plugin working with this code:

WifiWizard2.startScan().then(startscanresponse => {
            // Success
        }).catch(e => {
            console.log(JSON.stringify(e));
        });;

        WifiWizard2.getScanResults().then(response => {
            this.networksData = response;
        }).catch(e => {
            console.log(JSON.stringify(e));
        });

But the problem is that it updates the scan results after a very long period of time. In 120 seconds, I could only get 2 fingerprints of available WAPs.