Cannot find name 'WifiWizard2'

#1

Hi!

I’m trying to use the plugin WifiWizard2.

I added the plugin to my project by writing "ionic cordova plugin add wifiwizard2’ in the terminal. According to https://www.npmjs.com/package/wifiwizard2, there are muliple global functions, but when I write for instance WifiWizard2.getConnectedSSID(), I get the error Cannot find name ‘WifiWizard2’.

Does someone know what’s wrong?

#2

kindly share with us the ts file content.

Best Regards

#3

any updates ? where did you reach with the project?

#4

Hi, i’m trying same use of WifiWizard2… have you found a solution ?
How you import it ? there’s no sample code… :frowning:

#5

Here’s a sample of code using wifiwizard2 scan function


import { Component } from '@angular/core';

declare var WifiWizard2: any;

@Component({
    selector: 'app-home',
    templateUrl: 'home.page.html',
    styleUrls: ['home.page.scss'],
})
export class HomePage {
    results = [];
    info_txt = "";
    async getNetworks() {
    this.info_txt = "loading...";
    try {
        let results = await WifiWizard2.scan();
        this.results = results;
        this.info_txt = "";
    } catch (error) {
        this.info_txt = error;
    }
    }
}