@luisbytes/capacitor-telephony
v6.0.0
Published
TelephonyManager
Downloads
39
Readme
@luisbytes/capacitor-telephony
TelephonyManager only for Android
Install
npm install @luisbytes/capacitor-telephony
npx cap sync
Android setup
To use this plugin you need to add the following permissions to the AndroidManifest.xml
before or after the application
tag.
<uses-permission android:name="android.permission.READ_BASIC_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" android:maxSdkVersion="32" />
API
getInfo()
getInfo() => any
Returns: any
getNetworkType(...)
getNetworkType(options?: { withBasicPermission?: boolean | undefined; } | undefined) => any
| Param | Type |
| ------------- | ----------------------------------------------- |
| options
| { withBasicPermission?: boolean; } |
Returns: any
Interfaces
TelephonyInfo
| Prop | Type |
| ------------------------- | ------------------------------------------------------------------------------------- |
| dataState
| TelephonyDataState |
| signalStrengthLevel
| TelephonySignalStrengthLevel |
| simOperatorName
| string |
Enums
TelephonyDataState
| Members | Value |
| -------------------------- | ----------------------------------- |
| UNKNOWN
| "UNKNOWN" |
| DISCONNECTED
| "DISCONNECTED" |
| CONNECTING
| "CONNECTING" |
| CONNECTED
| "CONNECTED" |
| SUSPENDED
| "SUSPENDED" |
| DISCONNECTING
| "DISCONNECTING" |
| HANDOVER_IN_PROGRESS
| "HANDOVER_IN_PROGRESS" |
TelephonySignalStrengthLevel
| Members | Value |
| -------------- | ----------------------- |
| UNKNOWN
| "UNKNOWN" |
| NONE
| "NONE" |
| POOR
| "POOR" |
| MODERATE
| "MODERATE" |
| GOOD
| "GOOD" |
| GREAT
| "GREAT" |
TelephonyNetworkType
| Members | Value |
| ------------- | ---------------------- |
| UNKNOWN
| "UNKNOWN" |
| TWO_G
| "2G" |
| THREE_G
| "3G" |
| LTE
| "LTE" |
| FIVE_G
| "5G" |