@amazon-devices/expo-network provides useful information about the device’s network such as its IP address, MAC address, and airplane mode status.
Installation
- Add the JavaScript library dependency in the
package.jsonfile. Select the tab for your React Native version.
- React Native 0.72
- React Native 0.83
- Reinstall dependencies using
npm installcommand.
Examples
To test network features, you need to connect to the WiFi on your device shell. ReplaceNETWORK 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 falseNetwork.getNetworkStateAsync()-isInternetReachablefield is always missingNetwork.getNetworkStateAsync()-typefield can only be eitherNONEorWIFI

