Distinguish Wifi connection for application access

485 views Asked by At

We are developing an enterprise access mobile application which needs to run on particular wi-fi access.

To put it more simple, in the building where the application need to be accessed is having 4 wifi routers. but the requirement is that the application should run only when the device is connected to one specific wifi router.

As we are developing javascript (Cordova) based application, it is making sense if we some controls in that. by the way the application is targeted for both iOS and Android.

Any work in this area is really appreciated.

Thanks Aditya

1

There are 1 answers

3
Mark Veenstra On

Seems like this GitHub fork could help you (IOS is added in this fork): https://github.com/companje/org.apache.cordova.wifiinfo

Install

cordova plugin add https://github.com/companje/org.apache.cordova.wifiinfo

Get WifiInfo

navigator.wifi.getWifiInfo(success, error, options);

OnSuccessData

{
    connection: {
    BSSID: BSSID,
    HiddenSSID: HiddenSSID,
    SSID: SSID,
    MacAddress: MacAddress,
    IpAddressInt: IpAddressInt,
    IpAddress: IpAddress,
    NetworkId: NetworkId,
    RSSI: RSSI,
    LinkSpeed: LinkSpeed
    },

    networks: [
    {
        BSSID: BSSID,
        SSID: SSID,
        frequency: frequency,
        level: level,
        capabilities: capabilities
    },
    ...
    ]
}