doForeground
Introduction
Invoking this method when the APP changes to the foreground state.
The offline notification push of new messages will not be triggered, in this moment.
This method is supposed to be called manually on Android devices only, while the SDK can take in charger of it on iOS.
Parameter details
This API has no parameters
Returned template
V2TimCallback
{
code : number
desc : string
}
Return value details
name | type | description |
---|---|---|
code | number | Request result: Error codes. 0 means success. |
desc | string | The description of the error. It will be empty if success. |
Code example
import { TencentImSDKPlugin } from 'react-native-tim-js';
const doForegroundRes = await TencentImSDKPlugin.v2TIMManager
.getOfflinePushManager()
.doForeground();
if (doForegroundRes.code === 0) {
}