as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
@amazon-devices/expo-network provides useful information about the device’s network such as its IP address, MAC address, and airplane mode status.

Installation

  1. Add the JavaScript library dependency in the package.json file. Select the tab for your React Native version.
  1. Reinstall dependencies using npm install command.

Examples

To test network features, you need to connect to the WiFi on your device shell. Replace NETWORK and PASSWORD with your credentials.

API reference

Check out the dedicated documentation page for info about this library, API reference and more: Official Expo documentation for expo-network.

Methods

Implementation details

  • Network.isAirplaneModeEnabledAsync() - always returns false
  • Network.getNetworkStateAsync() - isInternetReachable field is always missing
  • Network.getNetworkStateAsync() - type field can only be either NONE or WIFI

Test on the simulator

You can test the network connection on the Vega Virtual Device by running the following commands.

Additional resources

For information on additional libraries, see Supported Third-Party Libraries and Services.
最后修改于 2026年8月3日