0.0.3 • Published 12 months ago

signal-plugin v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

signal-plugin

Simple Capacitor plugin to get the signal strength(LTE,WiFi,Acoustic).

Disclaimer

The plugin only works for Android and has not been completely tested, use it carefully!!

Install

npm install signal-plugin
npx cap sync

Example

The function getSignalInfo() return an object containing the value of the 3 measured signals:

  • WIFI
  • LTE
  • MICROPHONE
async getSignalInfo(){
    this.signalInfo = (await SignalPlugin.getSignalInfo()).value;
    console.log("WIFI: " + this.signalInfo.WIFI);
    console.log("LTE: " + this.signalInfo.LTE);
    console.log("MICROPHONE: " + this.signalInfo.MICROPHONE);
}

API

echo(...)

echo(options: { value: string; }) => Promise<{ value: string; }>
ParamType
options{ value: string; }

Returns: Promise<{ value: string; }>


getSignalInfo()

getSignalInfo() => Promise<{ value: any; }>

Returns: Promise<{ value: any; }>


checkPermissions()

checkPermissions() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


requestPermissions()

requestPermissions() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


Interfaces

PermissionStatus

PropType
WIFIPermissionState
LTEPermissionState
MICROPHONEPermissionState

Type Aliases

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago