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

Error alert when use getConnectedBSSID getConnectedSSID functions

sbellver opened this issue · comments

Prerequisites

Check all boxes if you have done the following:

Issue type

Select all that apply

  • Bug

Description

We use beta version for 3.0 from March. All works fine

Now, we need to recompile the app (ionic) and when we try to use WifiWizard functions ( getConnectedBSSID and getConnectedSSID) the app show an alert:

{"__zone_symbol__currentTask":{"type":"microTask","state":"notScheduled","source":"Promise.then","zone":"<root>","cancelFn":null,"runCount":0},"line":1233,"column":40,"sourceURL":"http://localhost:8080/var/containers/Bundle/Application/2FB59314-9A63-46F0-9F2C-7996AEBC19E2/Name.app/www/build/main.js"}

We start the project from zero (npm install, platform add, ...)

Versions

From node_modules / wifiwizard2 / package.json:
wifiwizard2@3.0.0
iOS

Nothing here? :(

Did you tried to use await or then and catch ?

Yes, we are using then/catch

cordova.plugin.WifiWizard2.getConnectedSSID().then((SSID)=>{
                    if(patt.test(SSID)){
                      cordova.plugin.WifiWizard2.getConnectedBSSID().then((mac)=>{
                        this.location.getCurrentPosition().then((resp) => {
                          console.log('coords: '+resp);
                          getrouteripaddress.getRouterIPAddress( function( IPadress ) {
                            console.log('ip: '+IPadress);
                            iab.create('http://'+IPadress+'/login?username='+session_user+'&password='+session_pass+'&lat='+resp.coords.latitude+'&long='+resp.coords.longitude+'&gw='+IPadress+'&mac='+mac, "_system");
                          } );
                        }).catch((error) => {
                          getrouteripaddress.getRouterIPAddress( function( IPadress ) {
                            console.log('location not found!!!');
                            iab.create('http://'+IPadress+'/login?username='+session_user+'&password='+session_pass+'&lat=0&long=0&gw='+IPadress+'&mac='+mac, "_system");
                          } );
                        });
                      });
                    }else{...

Now it's with cordova.plugin.* but first we try without it. In v3 beta was without it and works the same code, not sure why with stable version not.

@sbellver hmm this is weird, still having this issue i assume? I'm not really familiar with ionic, how to debug ionic, or decipher errors from ionic, but my first thought is what is located at:

"line":1233,"column":40

in http://localhost:8080/var/containers/Bundle/Application/2FB59314-9A63-46F0-9F2C-7996AEBC19E2/Name.app/www/build/main.js

Does this show when you use either getConnectedSSID OR getConnectedBSSID ? Can you try with just one at a time and see what it says?

Hi.

I need to restore previous code from git. Then, I have no errors.

Maybe is an issue with other plugin, or the order to install it, not sure.