Environment.getNetworkStatus
Functional API
getNetworkStatusYou can use the same feature with it as well.
Feature description
Gets the device's current network connection status. You can check whether it is connected to the internet and the connection type (Wi-Fi, mobile data, etc.).
Type
Environment.getNetworkStatus(): Promise<NetworkStatus>;Params
None
Response
type NetworkStatus =
| "OFFLINE" // Not connected to the internet
| "WIFI" // Wi-Fi
| "2G"
| "3G"
| "4G"
| "5G"
| "WWAN" // iOS only: Connected, but the type is unknown
| "UNKNOWN"; // Android only: Connection status is unknownExample code
Was this helpful?