TelephonyManager only for Android
npm install @luisbytes/capacitor-telephony
npx cap sync
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" />
getInfo() => Promise<TelephonyInfo>
Returns: Promise<TelephonyInfo>
getNetworkType(options?: { withBasicPermission?: boolean | undefined; } | undefined) => Promise<{ type: TelephonyNetworkType; }>
Param | Type |
---|---|
options |
{ withBasicPermission?: boolean; } |
Returns: Promise<{ type: TelephonyNetworkType; }>
Prop | Type |
---|---|
dataState |
TelephonyDataState |
signalStrengthLevel |
TelephonySignalStrengthLevel |
simOperatorName |
string |
Members | Value |
---|---|
UNKNOWN |
"UNKNOWN" |
DISCONNECTED |
"DISCONNECTED" |
CONNECTING |
"CONNECTING" |
CONNECTED |
"CONNECTED" |
SUSPENDED |
"SUSPENDED" |
DISCONNECTING |
"DISCONNECTING" |
HANDOVER_IN_PROGRESS |
"HANDOVER_IN_PROGRESS" |
Members | Value |
---|---|
UNKNOWN |
"UNKNOWN" |
NONE |
"NONE" |
POOR |
"POOR" |
MODERATE |
"MODERATE" |
GOOD |
"GOOD" |
GREAT |
"GREAT" |
Members | Value |
---|---|
UNKNOWN |
"UNKNOWN" |
TWO_G |
"2G" |
THREE_G |
"3G" |
LTE |
"LTE" |
FIVE_G |
"5G" |