This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Expo 蜂窝网络
提供有关用户的蜂窝服务提供商信息的 API。
expo-cellular 提供关于用户手机服务提供商的信息,比如它的唯一标识符和蜂窝连接类型。
安装
🌐 Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
配置
🌐 Configuration
Are you using this library in an existing React Native app?
如果你没有使用连续原生生成(CNG),或者你正在手动使用原生 android 项目,那么你需要在项目的 AndroidManifest.xml 中添加 android.permission.READ_PHONE_STATE 权限。这个权限用于 TelephonyManager。
🌐 If you're not using Continuous Native Generation (CNG) or you're using a native 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.
该库不需要更高风险的 READ_PRIVILEGED_PHONE_STATE 权限。
🌐 This library does not require the more risky READ_PRIVILEGED_PHONE_STATE permission.
应用接口
🌐 API
import * as Cellular from 'expo-cellular';
No API data file found, sorry!
错误代码
🌐 Error codes
权限
🌐 Permissions
安卓
🌐 Android
你必须将以下权限添加到你的 app.json 中的 expo.android.permissions 数组里。
🌐 You must add the following permissions to your app.json inside the expo.android.permissions array.
iOS
无需权限。
🌐 No permissions required.