sud.onNetworkStatusChange
JS
sud.onNetworkStatusChange(function callback)Listen for the network status change event
Parameters
- function callback: Callback function for the network status change event
Parameters of the callback function
- Object res: Returns the network status change information
Network status change information properties:
| Property | Type | Description |
|---|---|---|
| isConnected | boolean | Whether there is currently a network connection |
| networkType | string | Network type |
Valid values of networkType:
| Value | Description |
|---|---|
| wifi | Wi-Fi network |
| 2g | 2G network |
| 3g | 3G network |
| 4g | 4G network |
| 5g | 5G network |
| unknown | Uncommon network type on Android |
| none | No network |
