ソースを参照

fix:埋点程序启动。

“HeShaoZe” 4 ヶ月 前
コミット
3df4507ffb

+ 0 - 14
QuickSearchLocation/Classes/Main/AppDelegate.swift

@@ -18,8 +18,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         Thread.sleep(forTimeInterval: 1)
         Thread.sleep(forTimeInterval: 1)
         IQKeyboardManager.shared.enable = true
         IQKeyboardManager.shared.enable = true
         AMapServices.shared().apiKey = QSLConfig.MapKey
         AMapServices.shared().apiKey = QSLConfig.MapKey
-        //启动埋点
-        managerAppOnlyLaunch()
         return true
         return true
     }
     }
 
 
@@ -32,18 +30,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
     func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
     }
     }
 
 
-    //管理app启动埋点
-    func managerAppOnlyLaunch() {
-        
-        guard UserDefaults.standard.string(forKey: "MANAGER_APP_ONLY_LAUNCH") != nil else {
-            UserDefaults.standard.set("YES", forKey: "MANAGER_APP_ONLY_LAUNCH")
-            UserDefaults.standard.synchronize()
-            //只有app第一次启动才会埋点
-            gravityInstance?.track(QSLGravityConst.app_launch, properties: ["id": 02001])
-            return
-        }
-    }
-    
     // 当 App 即将终止(退出)时调用
     // 当 App 即将终止(退出)时调用
     func applicationWillTerminate(_ application: UIApplication) {
     func applicationWillTerminate(_ application: UIApplication) {
         print("App 即将退出")
         print("App 即将退出")

+ 15 - 0
QuickSearchLocation/Classes/Main/CustomTabBarController.swift

@@ -26,8 +26,23 @@ class CustomTabBarController: UITabBarController {
         self.addFoundationTab()
         self.addFoundationTab()
         // 默认进入页面到主页
         // 默认进入页面到主页
         self.selectedIndex = 1
         self.selectedIndex = 1
+        
+        managerAppOnlyLaunch()
+    }
+    
+    //管理app启动埋点
+    func managerAppOnlyLaunch() {
+        
+        guard UserDefaults.standard.string(forKey: "MANAGER_APP_ONLY_LAUNCH") != nil else {
+            UserDefaults.standard.set("YES", forKey: "MANAGER_APP_ONLY_LAUNCH")
+            UserDefaults.standard.synchronize()
+            //只有app第一次启动才会埋点
+            gravityInstance?.track(QSLGravityConst.app_launch, properties: ["id": 02001])
+            return
+        }
     }
     }
     
     
+    
     func addFoundationTab() {
     func addFoundationTab() {
         
         
         self.addFriendTab()
         self.addFriendTab()