Skip to main content

networkStatusChanged

Function Introduction

Description

Called when the client's network status changes.

Function Prototype

IMSDK.asyncApi('networkStatusChanged', operationID: string): Promise<void>

Input Parameters

Parameter NameParameter TypeRequiredDescription
operationIDstringYesOperation ID, for problem tracking. It is recommended to use the current time and a random number

Return Results

The function is Promise-ified using the openim-uniapp-polyfill package. When calling, use then and catch to judge and handle success and failure callbacks.

Parameter NameParameter TypeDescription
Promise.then()Promise<void>Successful callback
Promise.catch()Promise<CatchResponse>Failure callback

Code Example

import IMSDK from 'openim-uniapp-polyfill';

IMSDK.asyncApi('networkStatusChanged', IMSDK.uuid())
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});