Expo

Documentation

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.
Note: On the iOS simulator, cellular network information cannot be retrieved.

For managed apps, you'll need to run expo install expo-cellular. To use it in a bare React Native app, follow its installation instructions.

import * as Cellular from 'expo-cellular';

Indicates if the carrier allows making VoIP calls on its network. On Android, this checks whether the system supports SIP-based VoIP API. See here to view more information.
On iOS, if you configure a device for a carrier and then remove the SIM card, this property retains the boolean value indicating the carrier’s policy regarding VoIP. If you then install a new SIM card, its VoIP policy boolean replaces the previous value of this property.
On web, this returns null.

Cellular.allowsVoip; // true or false

The name of the user’s home cellular service provider. If the device has dual SIM cards, only the carrier for the currently active SIM card will be returned. On Android, this value is only available when the SIM state is SIM_STATE_READY. Otherwise, this returns null.
On iOS, if you configure a device for a carrier and then remove the SIM card, this property retains the name of the carrier. If you then install a new SIM card, its carrier name replaces the previous value of this property. The value for this property is null if the user never configured a carrier for the device.
On web, this returns null.

Cellular.carrier; // "T-Mobile" or "Verizon"

The ISO country code for the user’s cellular service provider. On iOS, the value is null if any of the following apply:
  • The device is in airplane mode.
  • There is no SIM card in the device.
  • The device is outside of cellular service range.
On web, this returns null.

Cellular.isoCountryCode; // "us" or "au"

The mobile country code (MCC) for the user’s current registered cellular service provider. On Android, this value is only available when SIM state is SIM_STATE_READY. Otherwise, this returns null. On iOS, the value may be null on hardware prior to iPhone 4S when in airplane mode. Furthermore, the value for this property is null if any of the following apply:
  • There is no SIM card in the device.
  • The device is outside of cellular service range.
On web, this returns null.

Cellular.mobileCountryCode; // "310"

The mobile network code (MNC) for the user’s cellular service provider. On Android, this value is only available when the SIM state is SIM_STATE_READY. Otherwise, this returns null. On iOS, the value may be null on hardware prior to iPhone 4S when in airplane mode. Furthermore, the value of this property is null if any of the following apply:
  • There is no SIM card in the device.
  • The device is outside of cellular service range.
On web, this returns null.

Cellular.mobileNetworkCode; // "260"

Returns a promise that resolves to a Cellular.CellularGeneration enum value that represents the current cellular-generation type.
On web, this method uses navigator.connection.effectiveType to detect the effective type of the connection using a combination of recently observed round-trip time and downlink values. See here to view browser compatibility.
Examples
await Cellular.getCellularGenerationAsync();
// CellularGeneration.CELLULAR_4G

Describes the current generation of the cellular connection. It is an enum with these possible values:
ValueDescription
UNKNOWNEither we are not currently connected to a cellular network or type could not be determined.
CELLULAR_2GCurrently connected to a 2G cellular network. Includes CDMA, EDGE, GPRS, and IDEN type connections.
CELLULAR_3GCurrently connected to a 3G cellular network. Includes EHRPD, EVDO, HSPA, HSUPA, HSDPA, and UTMS type connections.
CELLULAR_4GCurrently connected to a 4G cellular network. Includes HSPAP and LTE type connections.

CodeDescription
ERR_CELLULAR_GENERATION_UNKNOWN_NETWORK_TYPEUnable to access network type or not connected to a cellular network