All Products
Search
Document Center

SuperApp:Network status

Last Updated:Jun 02, 2026

Retrieves the current network type of the device. Use this API when developing H5 applications or mini programs with WindVane.

WVNetwork.getNetworkType

Retrieves the current network type. The result is always returned through the success callback.

window.WindVane.call('WVNetwork', 'getNetworkType', {}, function(e) {
        alert(JSON.stringify(e));
});

Input parameters

  • [boolean] wifiStatus: Specifies whether to retrieve details of the connected Wi-Fi network. Set to true to include ssid and bssid in the callback result. Applies only to active Wi-Fi connections. Requires WindVane 8.2.0 or later.

  • [boolean] wifiList: Specifies whether to retrieve a list of nearby Wi-Fi networks. Set to true to include wifiList in the callback result. Requires WindVane Android 8.2.0 or later. Not supported on iOS.

Callback parameters

These parameters are returned in the success callback.

  • [string] type: The current network type. Valid values:

    • 'WIFI': Connected to Wi-Fi.

    • '2G': Connected to a 2G network.

    • '3G': Connected to a 3G network.

    • '4G': Connected to a 4G network.

    • 'CELL': Connected to a cellular network. The network generation (2G/3G/4G) cannot be determined.

    • 'NONE': No network connection.

    • 'UNKNOWN': The network type cannot be determined.

  • [string] message: The name of the network system. Omitted when the network system is unknown.

  • [string] ssid: The SSID of the connected Wi-Fi network. Returned only when wifiStatus is true. Requires WindVane 8.2.0 or later.

  • [string] bssid: The BSSID of the connected Wi-Fi network. Returned only when wifiStatus is true. Requires WindVane 8.2.0 or later.

  • [Array] wifiList: A list of nearby Wi-Fi networks. Requires WindVane Android 8.2.0 or later. Not supported on iOS. Each item in the array is an object with the following properties:

  • [string] ssid: The SSID of the Wi-Fi network.

  • [string] bssid: The BSSID of the Wi-Fi network.