Using the nielsAD cordova-wifiscanner plugin


#1

This is my first foray into Meteor+Cordova. I’m hoping there’s something obvious that I’m missing.

I added the nielsAD/cordova-wifiscanner plugin like so:

meteor add cordova:nl.nielsad.cordova.wifiscanner@https://github.com/nielsAD/cordova-wifiscanner/tarball/cae9275c9ae83617b16389b4343c9a7a0a5ddd51

and it seems to have been successful. The plugin shows up as being installed.

However, when I attempt to use it like so:

onSuccess = function(result) {
    Session.set('result', result);
};
onError = function() {
    alert('Error!');
};
options = {frequency: 3000};
watchID = navigator.wifi.watchAccessPoints(onSuccess, onError, options);

launching it with meteor run android, the application comes up on the emulator but I get the error Uncaught TypeError: Cannot call method 'watchAccessPoints' of undefined

Am I just missing something obvious? Or is it tricky to get a plugin like this working in Meteor?


#2

#3

I’ve been through that page multiple times. I don’t see what on it can help me. How about a hint?


#4

are you using it inside startup function so all is correctly initialised by the time it try to execute it ?


#5

That was it, thanks. Don’t know how I missed that in the article.


#6

Glad I could help.
Who will log PR to make it bold red blinking text?
Cause I never used cordova, but noticed this issue everywhere :smiley: