docs/pages/versions/v54.0.0/sdk/cellular.mdx
import APISection from '/components/plugins/APISection';
import { APIInstallSection } from '/components/plugins/InstallSection';
import { AndroidPermissions } from '/components/plugins/permissions';
import { ConfigReactNative } from '/ui/components/ConfigSection';
expo-cellular provides information about the user's cellular service provider, such as its unique identifier, cellular connection type, and whether it allows VoIP calls on its network.
If you're not using Continuous Native Generation (CNG) or you're using native a android project manually, then you need to add android.permission.READ_PHONE_STATE permission to your project's AndroidManifest.xml. This permission is used for TelephonyManager.
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
This library does not require the more risky READ_PRIVILEGED_PHONE_STATE permission.
import * as Cellular from 'expo-cellular';
| Code | Description |
|---|---|
| ERR_CELLULAR_GENERATION_UNKNOWN_NETWORK_TYPE | Unable to access network type or not connected to a cellular network |
You must add the following permissions to your app.json inside the expo.android.permissions array.
<AndroidPermissions permissions={['READ_PHONE_STATE']} />
No permissions required.