doBackground method Null safety

Future<V2TimCallback> doBackground(
  1. {required int unreadCount}
)

This API can be called when the app detects that the app switches to the background. It can be used to specify the initial unread count of the desktop badge.

Starting from version 5.0.1 (native), if offline push is configured, the notification bar message sent by the manufacturer's offline push channel will be received. 

Parameter

unreadCount	Unread count
callback	Callback

Implementation

Future<V2TimCallback> doBackground({
  required int unreadCount,
}) async {
  return V2TimCallback.fromJson(
    formatJson(
      await _channel.invokeMethod(
        "doBackground",
        buildParam(
          {
            "unreadCount": unreadCount,
          },
        ),
      ),
    ),
  );
}