disconnect method
ZH
断开链接 注:因为 SDK 在前后台切换或者网络出现异常都会自动重连,保证连接可靠性。 所以除非您的 App 逻辑需要登出,否则一般不需要调用此方法进行手动断开
receivePush退出后是否接收 push,true:断开后接收远程推送,false:断开后不再接收远程推送返回值当次接口操作的状态码。0 代表调用成功 具体结果需要实现接口回调,非 0 代表当前接口调用操作失败,不会触发接口回调,详细错误参考错误码
EN
Disconnect Note: Since the SDK automatically reconnects when the app switches between foreground and background or when network exceptions occur, ensuring connection reliability, this method is generally not required for manual disconnection unless your app logic requires logout.
receivePushSpecifies whether to receive push notifications after disconnection. true: continue receiving remote push notifications after disconnection; false: stop receiving remote push notifications after disconnection. call, and the specific result needs to be handled through the interface callback. Non-zero indicates that the current operation failed, and the interface callback will not be triggered. Refer to the error codes for detailed error information.
Implementation
Future<int> disconnect(bool receivePush) async {
return RCIMWrapperPlatform.instance.disconnect(receivePush);
}