Steven 2 năm trước cách đây
mục cha
commit
9d47d0c640

+ 2 - 2
KulexiuForStudent/KulexiuForStudent.xcodeproj/project.pbxproj

@@ -7394,7 +7394,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_ENTITLEMENTS = KulexiuForStudent/KulexiuForStudent.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1.3.8;
+				CURRENT_PROJECT_VERSION = 1.3.8.1;
 				DEVELOPMENT_TEAM = B2AP53HHTU;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -7466,7 +7466,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_ENTITLEMENTS = KulexiuForStudent/KulexiuForStudent.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1.3.8;
+				CURRENT_PROJECT_VERSION = 1.3.8.1;
 				DEVELOPMENT_TEAM = B2AP53HHTU;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (

BIN
KulexiuForStudent/KulexiuForStudent.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate


+ 36 - 4
KulexiuForStudent/KulexiuForStudent.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -74,8 +74,8 @@
             filePath = "KulexiuForStudent/AppDelegate.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "836"
-            endingLineNumber = "836"
+            startingLineNumber = "833"
+            endingLineNumber = "833"
             landmarkName = "-handleOutLink:"
             landmarkType = "7">
          </BreakpointContent>
@@ -90,8 +90,8 @@
             filePath = "KulexiuForStudent/AppDelegate.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "881"
-            endingLineNumber = "881"
+            startingLineNumber = "878"
+            endingLineNumber = "878"
             landmarkName = "-handleOutLink:"
             landmarkType = "7">
          </BreakpointContent>
@@ -239,5 +239,37 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "536400B0-83CF-4B41-93D4-D99F2FBB7F56"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KulexiuForStudent/Module/Login/Model/UserInfoManager.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "379"
+            endingLineNumber = "379"
+            landmarkName = "-startUMCountAndLoginCount"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "F766E8F7-995E-4457-ADEA-221DE2E627BE"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KulexiuForStudent/AppDelegate.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "392"
+            endingLineNumber = "392"
+            landmarkName = "-application:didRegisterForRemoteNotificationsWithDeviceToken:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 1 - 4
KulexiuForStudent/KulexiuForStudent/AppDelegate.m

@@ -65,7 +65,6 @@
 
 @property (nonatomic, assign) BOOL hasCheckTrackAuth;
 
-
 @end
 
 @implementation AppDelegate
@@ -168,7 +167,7 @@
         }
         else {
             [KSNetworkingManager configRequestHeader];
-            [USER_MANAGER queryUserInfoConnectRongCloud:YES];
+            [USER_MANAGER queryUserInfoSendLoginUMCount];
             [self initTableBar];
             self.window.rootViewController=_tabBarController;
         }
@@ -202,8 +201,6 @@
 
     [UMConfigure initWithAppkey:@"62a2a806eae04539a8e253ed" channel:@"App Store"];
 
-    [USER_MANAGER startCountUMEvent];
-    [USER_MANAGER sendUMEvent:@"klx_login"];
     [UMConfigure setLogEnabled:YES];
     // 配置友盟分享
     // 微信、QQ、微博完整版会校验合法的universalLink,不设置会在初始化平台失败

+ 1 - 0
KulexiuForStudent/KulexiuForStudent/Info.plist

@@ -74,6 +74,7 @@
 	</dict>
 	<key>UIBackgroundModes</key>
 	<array>
+		<string>remote-notification</string>
 		<string>voip</string>
 	</array>
 </dict>

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Login/Controller/PasswordLoginController.m

@@ -79,7 +79,7 @@
                 [KSNetworkingManager configRequestHeader];
                 
                 // 获取用户信息并登录融云
-                [USER_MANAGER queryUserInfoConnectRongCloud:YES];
+                [USER_MANAGER queryUserInfoSendLoginUMCount];
                 MJWeakSelf;
                 [self KSShowMsg:@"登录成功" promptCompletion:^{
                     [weakSelf toHomeView];

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Login/Controller/VefiCodeLoginController.m

@@ -148,7 +148,7 @@
             [KSNetworkingManager configRequestHeader];
             
             // 获取用户信息并登录融云
-            [USER_MANAGER queryUserInfoConnectRongCloud:YES];
+            [USER_MANAGER queryUserInfoSendLoginUMCount];
             MJWeakSelf;
             [self KSShowMsg:@"登录成功" promptCompletion:^{
                 if ([result boolValueForKey:@"password"] == YES) {

+ 3 - 1
KulexiuForStudent/KulexiuForStudent/Module/Login/Model/UserInfoManager.h

@@ -34,6 +34,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)queryUserInfoConnectRongCloud:(BOOL)connectRM;
 
+- (void)queryUserInfoSendLoginUMCount;
+
 - (void)checkTokenEnableConnectRongCloud;
 
 - (BOOL)checkIMConnected;
@@ -42,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (NSString *)getCurrentVersion;
 
-- (void)startCountUMEvent;
+- (BOOL)startCountUMEvent;
 
 - (void)stopCountUMEvent;
 

+ 55 - 2
KulexiuForStudent/KulexiuForStudent/Module/Login/Model/UserInfoManager.m

@@ -333,8 +333,61 @@
     }
 }
 
-- (void)startCountUMEvent {
-    [MobClick profileSignInWithPUID:UserDefault(UIDKey)];
+
+- (void)queryUserInfoSendLoginUMCount {
+    [KSNetworkingManager queryUserInfo:KS_GET success:^(NSDictionary * _Nonnull dic) {
+        if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
+            // 保存用户信息
+            self.userInfo = [[UserInfo alloc] initWithDictionary:[dic dictionaryValueForKey:@"data"]];
+            // 判断是否实名
+            if (![NSString isEmptyString:self.userInfo.realName] && ![NSString isEmptyString:self.userInfo.idCardNo]) {
+                self.hasAuth = YES;
+            }
+            else {
+                self.hasAuth = NO;
+            }
+            
+            NSString *uid = self.userInfo.userId;
+            UserDefaultSet(uid, UIDKey);
+            NSString *rongToken = UserDefault(RongTokenKey);
+            BOOL needConnect = NO;
+            if ([NSString isEmptyString:rongToken]) {
+                needConnect = YES;
+            }
+            UserDefaultSet(self.userInfo.imToken, RongTokenKey);
+            UserDefaultSet(self.userInfo.username, NicknameKey);
+            UserDefaultSet(self.userInfo.avatar, AvatarUrlKey);
+            [[NSUserDefaults standardUserDefaults] synchronize];
+            
+            // 设置推送别名
+            [JPUSHService setAlias:UserDefault(UIDKey) completion:nil seq:0];
+            [Bugly setUserIdentifier:UserDefault(UIDKey)];
+            [self connectRongCloud];
+            [self startUMCountAndLoginCount];
+            
+        }
+        else {
+           
+        }
+    } faliure:^(NSError * _Nonnull error) {
+        
+    }];
+}
+
+- (void)startUMCountAndLoginCount {
+    [self startCountUMEvent];
+    [self sendUMEvent:@"klx_login"];
+}
+
+- (BOOL)startCountUMEvent {
+    NSString *userId = UserDefault(UIDKey);
+    if ([NSString isEmptyString:userId]) {
+        return NO;
+    }
+    else {
+        [MobClick profileSignInWithPUID:userId];
+        return YES;
+    }
 }
 
 - (void)stopCountUMEvent {