I have to get a list of wifi networks and their signal power. I found WifiWizard cordova plugin and tried to use it in my app but it does not work. I’ve also followed this topic but didn’t find solution.
What I’ve tried so far:
declaring WifiWizard as let: declare let WifiWizard: any;
changing wifiWizard in config.xml and using different values
calling window.WifiWizard as it defined in plugins.xml: <clobbers target="window.WifiWizard"/>
added WifiWizard.js to the www folder
Do you have any idea why I can’t call method from this class on WifiWizard object? How to make it work? Maybe there is another way to get wifi signal strength?
Thanks for your help! One more thing that is a little bit annoying - why there is no suggesting when I’m typing the WifiWizard. and first letters of the function or object’s property? I’m using VS Code.
You won’t have any intellisense. The plugin itself is not written in typescript and I’m not using any typescript definition.
I referred to the documentation and used the debugger to know what functions I needed.
The best approach (and only approach to consider) is to have a provider with all the required functions being called properly and use said provider instead of direct. If you want to give yourself a little extra pat on on the back have the provider return promises instead of callbacks.
Think of the way Ionic Native providers work (e.g. camera, file).
The Provider part was a recommendation. Instead of using the library directly - it’s always best to wrap the functionality required into your own provider (e.g. ionic g provider WifiSomething) and use that instead.
I would recommend this approach always - a couple of benefits…