unInitSDK method

Future<V2TimCallback> unInitSDK()

反初始化 SDK

Implementation

Future<V2TimCallback> unInitSDK() async {
  if (kIsWeb) {
    await TencentCloudChatSdkPlatform.instance.removeAdvancedMsgListener();
    await TencentCloudChatSdkPlatform.instance.removeConversationListener();
    await TencentCloudChatSdkPlatform.instance.removeFriendListener();
    await TencentCloudChatSdkPlatform.instance.removeGroupListener();
    await TencentCloudChatSdkPlatform.instance.removeSimpleMsgListener();
    await TencentCloudChatSdkPlatform.instance.removeSignalingListener();

    V2TimCallback res = await TencentCloudChatSdkPlatform.instance.unInitSDK();
    if (res.code == 0) {
      currentLoginInfo.remove(currentLoginSDKAPPIDKey);
      currentLoginInfo.remove(currentLoginUserIDKey);
      currentLoginInfo.remove(currentLoginSigKey);
    }
    return res;
  }

  v2TIMSDKListenerList.clear();
  bool result = TIMManager.instance.unInitSDK();
  if (result) {
    currentLoginInfo.remove(currentLoginSDKAPPIDKey);
    currentLoginInfo.remove(currentLoginUserIDKey);
    currentLoginInfo.remove(currentLoginSigKey);
  }

  return V2TimCallback.fromBool(result, '');
}