Skip to main content

expo-cellular

Version: 55.0.6 Provides information about the user’s cellular service provider, such as carrier name and country.

Installation

npx expo install expo-cellular

Usage

import * as Cellular from 'expo-cellular';

const carrier = await Cellular.getCarrierNameAsync();
const isoCountryCode = await Cellular.getIsoCountryCodeAsync();
const mobileCountryCode = await Cellular.getMobileCountryCodeAsync();

console.log('Carrier:', carrier);
console.log('Country:', isoCountryCode);

API Reference

Methods

Cellular.getCarrierNameAsync()
() => Promise<string | null>
Gets the carrier/network operator name
const carrier = await Cellular.getCarrierNameAsync();
console.log(carrier); // "Verizon", "T-Mobile", etc.
Cellular.getIsoCountryCodeAsync()
() => Promise<string | null>
Gets the ISO country code
const country = await Cellular.getIsoCountryCodeAsync();
console.log(country); // "us", "gb", "jp", etc.
Cellular.getMobileCountryCodeAsync()
() => Promise<string | null>
Gets the mobile country code (MCC)
Cellular.getMobileNetworkCodeAsync()
() => Promise<string | null>
Gets the mobile network code (MNC)
Cellular.allowsVoip
boolean | null
iOS only: Whether the carrier allows VoIP calls

Constants

Cellular.Cellular
Cellular
Enum for cellular generation:
  • Cellular.Cellular.UNKNOWN
  • Cellular.Cellular.CELLULAR_2G
  • Cellular.Cellular.CELLULAR_3G
  • Cellular.Cellular.CELLULAR_4G
  • Cellular.Cellular.CELLULAR_5G

Examples

Display Carrier Info

import * as Cellular from 'expo-cellular';
import { useEffect, useState } from 'react';
import { Text, View } from 'react-native';

function CarrierInfo() {
  const [info, setInfo] = useState<{
    carrier: string | null;
    country: string | null;
  }>({ carrier: null, country: null });

  useEffect(() => {
    async function loadCarrierInfo() {
      const carrier = await Cellular.getCarrierNameAsync();
      const country = await Cellular.getIsoCountryCodeAsync();
      setInfo({ carrier, country });
    }
    loadCarrierInfo();
  }, []);

  return (
    <View>
      <Text>Carrier: {info.carrier || 'Unknown'}</Text>
      <Text>Country: {info.country?.toUpperCase() || 'Unknown'}</Text>
    </View>
  );
}

Platform Support

PlatformSupported
iOS
Android
Web

Resources

Build docs developers (and LLMs) love