wenweiwei пре 4 година
родитељ
комит
e67489d800

+ 4 - 4
MusicVideoPlus/MusicVideoPlus.xcodeproj/project.pbxproj

@@ -9,7 +9,7 @@
 /* Begin PBXBuildFile section */
 		2D076756266DF8E300E64472 /* PQServerProtocalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D076755266DF8E300E64472 /* PQServerProtocalView.swift */; };
 		2D076758266E08E700E64472 /* MVHomeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D076757266E08E700E64472 /* MVHomeController.swift */; };
-		2D1EC138266B4F4900CBACE4 /* MVUMApiUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D1EC137266B4F4900CBACE4 /* MVUMApiUtil.swift */; };
+		2D1EC138266B4F4900CBACE4 /* MVThirdApiUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D1EC137266B4F4900CBACE4 /* MVThirdApiUtil.swift */; };
 		4112DD832669BFA600A5AFD9 /* MVBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4112DD822669BFA600A5AFD9 /* MVBanner.swift */; };
 		4112DD862669BFFA00A5AFD9 /* MVBannerFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4112DD852669BFFA00A5AFD9 /* MVBannerFlowLayout.swift */; };
 		4112DD912669C11C00A5AFD9 /* MVBannerCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4112DD902669C11C00A5AFD9 /* MVBannerCell.swift */; };
@@ -32,7 +32,7 @@
 /* Begin PBXFileReference section */
 		2D076755266DF8E300E64472 /* PQServerProtocalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PQServerProtocalView.swift; sourceTree = "<group>"; };
 		2D076757266E08E700E64472 /* MVHomeController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MVHomeController.swift; sourceTree = "<group>"; };
-		2D1EC137266B4F4900CBACE4 /* MVUMApiUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVUMApiUtil.swift; sourceTree = "<group>"; };
+		2D1EC137266B4F4900CBACE4 /* MVThirdApiUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVThirdApiUtil.swift; sourceTree = "<group>"; };
 		3FA19A38D145C54301B3CD85 /* Pods_MusicVideoPlus.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MusicVideoPlus.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		4112DCF02668C45B00A5AFD9 /* MusicVideoPlus.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MusicVideoPlus.entitlements; sourceTree = "<group>"; };
 		4112DD492668D6A600A5AFD9 /* MusicVideoPlus-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MusicVideoPlus-Bridging-Header.h"; sourceTree = "<group>"; };
@@ -81,7 +81,7 @@
 		2D1EC136266B4F3300CBACE4 /* Utils */ = {
 			isa = PBXGroup;
 			children = (
-				2D1EC137266B4F4900CBACE4 /* MVUMApiUtil.swift */,
+				2D1EC137266B4F4900CBACE4 /* MVThirdApiUtil.swift */,
 			);
 			name = Utils;
 			path = Modules/Utils;
@@ -571,7 +571,7 @@
 				417D86A7266A3CC900DA2444 /* MVHotVideoModel.swift in Sources */,
 				4149C8932669FE6F0055CAA2 /* MVTagsCell.swift in Sources */,
 				4112DD832669BFA600A5AFD9 /* MVBanner.swift in Sources */,
-				2D1EC138266B4F4900CBACE4 /* MVUMApiUtil.swift in Sources */,
+				2D1EC138266B4F4900CBACE4 /* MVThirdApiUtil.swift in Sources */,
 				2D076756266DF8E300E64472 /* PQServerProtocalView.swift in Sources */,
 				41CA6E69266788C000874B19 /* MVLoginController.swift in Sources */,
 				41CA6E662667887C00874B19 /* MVMineController.swift in Sources */,

+ 3 - 1
MusicVideoPlus/MusicVideoPlus/AppDelegate.swift

@@ -29,7 +29,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         wxappInfo.scope = "snsapi_userinfo"
         PQSingletoWXApiUtil.shared.registerApp(appInfo: wxappInfo)
         // 注册友盟
-        MVUMApiUtil.register()
+        MVThirdApiUtil.registerUM()
+        // 注册bugly
+        MVThirdApiUtil.registerBugly()
         return true
     }
 

+ 29 - 3
MusicVideoPlus/MusicVideoPlus/Classes/Modules/Utils/MVUMApiUtil.swift → MusicVideoPlus/MusicVideoPlus/Classes/Modules/Utils/MVThirdApiUtil.swift

@@ -1,18 +1,43 @@
 //
-//  MVUMApiUtil.swift
+//  MVThirdApiUtil.swift
 //  MusicVideoPlus
 //
 //  Created by SanW on 2021/6/5.
 //
 
 import BFFramework
+import Bugly
 import UIKit
 
 // MARK: - 友盟相关工具类
 
 /// 友盟相关工具类
-class MVUMApiUtil: NSObject {
-    class func register() {
+class MVThirdApiUtil: NSObject {
+    // 注册
+    class func registerBugly() {
+        // 注册bugly
+        let buglyConfig = BuglyConfig()
+        buglyConfig.reportLogLevel = .warn
+        #if DEBUG
+            buglyConfig.version = versionName + ".6666"
+        #else
+            if PQENVUtil.shared.envMode == .ENVModeOnline {
+                buglyConfig.version = versionName + "." + versionCode
+            } else if PQENVUtil.shared.envMode == .ENVModePre {
+                buglyConfig.version = versionName + ".8888"
+            } else {
+                buglyConfig.version = versionName + ".9999"
+            }
+        #endif
+        buglyConfig.channel = PQBFConfig.shared.channelID
+        buglyConfig.deviceIdentifier = BFLoginUserInfo.shared.isLogin() ? BFLoginUserInfo.shared.uid : getMachineCode()
+        buglyConfig.unexpectedTerminatingDetectionEnable = true
+        buglyConfig.blockMonitorEnable = true
+        buglyConfig.blockMonitorTimeout = 2
+        Bugly.start(withAppId: PQBFConfig.shared.buglyAppkey, config: buglyConfig)
+    }
+
+    class func registerUM() {
         // 注册友盟
         UMConfigure.setEncryptEnabled(true)
         // 初始化友盟所有组件产品
@@ -22,6 +47,7 @@ class MVUMApiUtil: NSObject {
         #endif
         BFLog(message: "友盟版本号:\(UMConfigure.version())")
     }
+
     /// 页面时长统计
     /// - Parameters:
     ///   - pageName: 页面名称