This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Expo 网络
提供对设备网络的访问(例如其 IP 地址、MAC 地址和飞行模式状态)的库。
Android
iOS
tvOS
Web
Included in Expo Go
Recommended version:
~58.0.3
expo-network 提供了有关设备网络的有用信息,例如其 IP 地址、MAC 地址和飞行模式状态。
安装
🌐 Installation
Terminal
If you are installing this in an existing React Native app, make sure to install expo in your project.
配置
🌐 Configuration
在 Android 上,此模块需要权限来访问网络和 Wi-Fi 状态。权限 ACCESS_NETWORK_STATE 和 ACCESS_WIFI_STATE 会自动添加。
🌐 On Android, this module requires permissions to access the network and Wi-Fi state. The permissions ACCESS_NETWORK_STATE and ACCESS_WIFI_STATE are added automatically.
应用接口
🌐 API
import * as Network from 'expo-network';
No API data file found, sorry!
错误代码
🌐 Error codes