doBackground

Introduction

Invoking this method when the APP changes to the background state.

You can listen to Android activity lifeCycle events according to this document.

The offline notification push of new messages will be triggered immediately, after you config the related settings.

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

Parameter name Parameter type Required Platform Description
unreadCount int yes All unread count of message in app

Returned template

V2TimCallback

{
    code : int
    desc : String
}

Return value details

name type description
code int Request result: Error codes. 0 means success.
desc String The description of the error. It will be empty if success.V2TimMsgCreateInfoResult

Code example

    V2TimCallback doBackgroundRes = await TencentImSDKPlugin.v2TIMManager
        .getOfflinePushManager()
        .doBackground(unreadCount: 0);
    if (doBackgroundRes.code == 0) {
    }

results matching ""

    No results matching ""