doForeground method

Future<V2TimCallback> doForeground()

APP 检测到应用进前台时可以调用此接口

从5.0.1(native)版本开始,对应 doBackground,会停止厂商的离线推送。但如果应用被 kill,仍然可以正常接收离线推送 注意:仅安卓端需要调用。

参数

callback	回调

Implementation

Future<V2TimCallback> doForeground() async {
  return V2TimCallback.fromJson(
    formatJson(
      await _channel.invokeMethod(
        "doForeground",
        buildParam(
          {
            "ability": Utils.getAbility(),
          },
        ),
      ),
    ),
  );
}