# Using cordova plugin (WifiWizard) with Ionic app

**URL:** <https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692>\
**Category:** ionic-v3\
**Created:** [October 12, 2017, 9:25pm UTC](https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692 "2017-10-12T21:25:14Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcichecki](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@mcichecki](https://forum.ionicframework.com/u/mcichecki)\
**Post date:** [October 12, 2017, 9:25pm UTC](https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692/1 "2017-10-12T21:25:14Z")

</div>

Hi

I have to get a list of wifi networks and their signal power. I found [WifiWizard](https://github.com/hoerresb/WifiWizard) cordova plugin and tried to use it in my app but it does not work. I’ve also followed this [topic](https://forum.ionicframework.com/t/how-to-use-non-native-plugins-on-ionic/63936) 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?

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [October 12, 2017, 10:31pm UTC](https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692/2 "2017-10-12T22:31:46Z")

</div>

Hi,

What exactly is the problem???

I’ve JUST now set up a repo with it running on my android device…

Check out my github and the screengrabs

> **[judgewest2000/IonicWiFiWizardExample](https://github.com/judgewest2000/IonicWiFiWizardExample)**
>
> An example of Ionic with WiFiWizard (Android Only I think looking at the docs) - judgewest2000/IonicWiFiWizardExample

![Screenshot_2017-10-12-23-30-29](https://global.discourse-cdn.com/ionicframework/original/3X/5/6/563d66922318bf8bf6acbbe8f4c342e025e116dd.png)

 ![Screenshot_2017-10-12-23-30-16](https://global.discourse-cdn.com/ionicframework/original/3X/c/4/c41b846801ae958cdefc1641d7d6f91ca9e9db83.png)

 ![Screenshot_2017-10-12-23-30-34](https://global.discourse-cdn.com/ionicframework/original/3X/f/6/f61bc3d4a14cadc599da084f9dc8ce2c5bf6dbb9.png)

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [October 12, 2017, 10:35pm UTC](https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692/3 "2017-10-12T22:35:06Z")

</div>

Apologies if you just had a look at the repo - forgot to check the code in.

It’s all there now.

---

<div class="post-metadata">

**Author:** ![mcichecki](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@mcichecki](https://forum.ionicframework.com/u/mcichecki)\
**Post date:** [October 13, 2017, 7:08am UTC](https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692/4 "2017-10-13T07:08:06Z")

</div>

I will take a look at it later but could you tell me how did you install the plugin (what terminal command did you use?)

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [October 13, 2017, 7:38am UTC](https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692/5 "2017-10-13T07:38:15Z")

</div>

```auto
npm install https://github.com/hoerresb/WifiWizard --save

```

Straight to source.

(EDIT)  
Actually thinking about it I might’ve typed in

```auto
cordova plugin add https://github.com/hoerresb/WifiWizard --save

```

Sorry I mix em up when I’m tired. Notice the lack of ‘ionic’ at the beginning on that statement…

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [October 13, 2017, 12:44pm UTC](https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692/6 "2017-10-13T12:44:38Z")

</div>

Please mark as ‘like’ or ‘solution’ where appropriate. Basic ‘thank you’ courtesy

---

<div class="post-metadata">

**Author:** ![mcichecki](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@mcichecki](https://forum.ionicframework.com/u/mcichecki)\
**Post date:** [October 14, 2017, 3:36pm UTC](https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692/7 "2017-10-14T15:36:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [October 14, 2017, 3:51pm UTC](https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692/8 "2017-10-14T15:51:17Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Perinban](https://avatars.discourse-cdn.com/v4/letter/p/2acd7d/32.png) [@Perinban](https://forum.ionicframework.com/u/Perinban)\
**Post date:** [March 10, 2018, 5:29am UTC](https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692/9 "2018-03-10T05:29:34Z")

</div>

Is there anything I can make use of to get the signal strengths in wifi wizard?

---

<div class="post-metadata">

**Author:** ![mcichecki](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@mcichecki](https://forum.ionicframework.com/u/mcichecki)\
**Post date:** [March 10, 2018, 11:11am UTC](https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692/10 "2018-03-10T11:11:02Z")

</div>

you can get RSSI which is Received Signal Strength Indicator

---

<div class="post-metadata">

**Author:** ![gargoor](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@gargoor](https://forum.ionicframework.com/u/gargoor)\
**Post date:** [January 10, 2019, 5:32am UTC](https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692/11 "2019-01-10T05:32:28Z")

</div>

> [@Judgewest2000](#):
>
> ```auto
> cordova plugin add https://github.com/hoerresb/WifiWizard --save
> 
> ```

What do you mean exactly? provider instead of direct

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [January 10, 2019, 9:51am UTC](https://forum.ionicframework.com/t/using-cordova-plugin-wifiwizard-with-ionic-app/108692/12 "2019-01-10T09:51:43Z")

</div>

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…

- Much easier for testing as you can create mock versions of your provider for testing in a browser…  
[https://github.com/judgewest2000/IonicDependencySwapExample](https://github.com/judgewest2000/IonicDependencySwapExample)

- You abstract all the complexity of the library to just what you need for ease of use

- Swapping the dependency for something later on doesn’t mean changing your code in anywhere other than one file
