> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# my.onNetworkStatusChange

> Listen for network status changes.

Use this API to listen for network status changes. Listening starts automatically when the API is called; the callback interval is 500 ms. Call `my.offNetworkStatusChange` to stop listening.

## Parameters

| Property | Type | Required | Description |
| - | - | - | - |
| listener | Function | Yes | Callback invoked when the network status changes |

## Listener Callback

| Property | Type | Description |
| - | - | - |
| isConnected | Boolean | Whether the network is connected |
| networkType | String | Network type: `UNKNOWN`, `NOTREACHABLE`, `WWAN`, `WIFI`, `2G`, `3G`, `4G`, `5G`. On Android, `UNKNOWN` is returned if the permission to read phone information is set to "ask" or "deny" |
| signalStrength | Number | Signal strength in dBm, only when `networkType` is `WIFI`. Android only |
| hasSystemProxy | Boolean | Whether a network proxy is in use |

## Code Example

```javascript theme={null}
Page({
  onLoad() {
    this.onNetworkChange = (res) => {
      console.log('Connected:', res.isConnected, 'Type:', res.networkType);
    };
    my.onNetworkStatusChange(this.onNetworkChange);
  },
  onUnload() {
    my.offNetworkStatusChange(this.onNetworkChange);
  }
});
```

## Related APIs

> [card] [my.offNetworkStatusChange](https://docs.rebellapp.com/jsapi/device/network-status/my.offNetworkStatusChange.md)
>
> Stop listening

> [card] [my.getNetworkType](https://docs.rebellapp.com/jsapi/device/network-status/my.getNetworkType.md)
>
> Get the current network type


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.