emcniece / cordova-plugin-rssi

Reports the WiFi RSSI for Android and iOS
MIT License
7 stars 3 forks source link

Cordova RSSI Plugin

This plugin allows you to read WiFi RSSI from applications developed using Cordova 3.0 or newer.

Works on both Android and iOS platforms, but will not pass the Apple App Store Review process.

Tested on iOS Simulator devices: iPhone 5, 6, 7, 8, SE, X, XR, XS, XS Max

NOTE: Does not return any values for iPad at this time.

Installation

In your application project directory:

cordova plugin add cordova-plugin-rssi

Usage

const rssi = cordova.plugins.rssi;

rssi.read(success, failure)

Returns the device's current WiFi RSSI information via 3 parameters:

rssi.read(function success(data){
    console.log(data);
    // -> {rssi: -38, bars: 4, isIPhoneX: false}
});

Browser / Development Usage

While developing in browser, a mock can be utilized to prevent errors. See an example Ionic 4 app at emcniece/ionic-cordova-rssi-demo.

References

Attribution

This open-source project was made possible by some fine people over at CNY Apps.

Licence

The MIT License

Changelog