Steven 1 년 전
부모
커밋
4de74d8ce7
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      KulexiuForStudent/KulexiuForStudent/AppDelegate.m

+ 7 - 0
KulexiuForStudent/KulexiuForStudent/AppDelegate.m

@@ -423,11 +423,18 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
     if (self.isNeedUpdate) {
         [self versionCheck];
     }
+    [self checkConnectionStatus];
 
     // 退到后台发送消息
     [[NSNotificationCenter defaultCenter] postNotificationName:@"appEnterForeground" object:nil];
 }
 
+- (void)checkConnectionStatus {
+    BOOL isConnected = [TXIM_LINSENTER isCurrentUserLoginIM];
+    if (isConnected == NO) { // 连接失败或未连接 需要重新连接
+        [USER_MANAGER checkTokenEnableConnectIM];
+    }
+}
 
 - (void)applicationDidBecomeActive:(UIApplication *)application {
     // app启动或者app从后台进入前台都会调用这个方法