wenweiwei пре 3 година
родитељ
комит
9d4a8af6ea

+ 8 - 0
Introduce.xcodeproj/project.pbxproj

@@ -23,6 +23,7 @@
 
 /* Begin PBXFileReference section */
 		2D80D52A2773528C00D24520 /* INAppConfigUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = INAppConfigUtil.swift; sourceTree = "<group>"; };
+		2D80D52C27741AC100D24520 /* Introduce-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Introduce-Bridging-Header.h"; sourceTree = "<group>"; };
 		3051DB0957784182F3E1AAD3 /* Pods-Introduce.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Introduce.release.xcconfig"; path = "Target Support Files/Pods-Introduce/Pods-Introduce.release.xcconfig"; sourceTree = "<group>"; };
 		3D67E85C017389B87957100F /* Pods_Introduce.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Introduce.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		415C49D12763022900814766 /* Resources.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Resources.bundle; path = Aarchitecture/Resources.bundle; sourceTree = "<group>"; };
@@ -111,6 +112,7 @@
 				4A426DFB2754A4B200B3733B /* INIntroduceController.swift */,
 				4A426DFD2754A4F600B3733B /* INVideoExportController.swift */,
 				2D80D52A2773528C00D24520 /* INAppConfigUtil.swift */,
+				2D80D52C27741AC100D24520 /* Introduce-Bridging-Header.h */,
 			);
 			path = Record;
 			sourceTree = "<group>";
@@ -174,6 +176,7 @@
 				TargetAttributes = {
 					4A426DD8275484DF00B3733B = {
 						CreatedOnToolsVersion = 13.1;
+						LastSwiftMigration = 1310;
 					};
 				};
 			};
@@ -420,6 +423,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
+				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 0.51;
 				DEVELOPMENT_TEAM = UH52C8A7SN;
@@ -448,6 +452,8 @@
 				PRODUCT_BUNDLE_IDENTIFIER = com.piaoquan.introduce;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_EMIT_LOC_STRINGS = YES;
+				SWIFT_OBJC_BRIDGING_HEADER = "Introduce/Record/Introduce-Bridging-Header.h";
+				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
 				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = 1;
 			};
@@ -460,6 +466,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
+				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 0.51;
 				DEVELOPMENT_TEAM = UH52C8A7SN;
@@ -488,6 +495,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = com.piaoquan.introduce;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_EMIT_LOC_STRINGS = YES;
+				SWIFT_OBJC_BRIDGING_HEADER = "Introduce/Record/Introduce-Bridging-Header.h";
 				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = 1;
 			};

+ 13 - 10
Introduce/Record/INAppConfigUtil.swift

@@ -31,20 +31,23 @@ class INAppConfigUtil: NSObject {
     }
 
     class func applicationConfig(launchOptions _: [UIApplication.LaunchOptionsKey: Any]?) {
-//        // 初始化友盟
-//        CMUMApiUtil.registerUM(umAppkey: "6114dfeb1fee2e303c1fa189")
-//        // 初始化Bugly
-//        CMBuglyUtil.registerBugly(appID: "87b0f37276", deviceId: getMachineCode())
-//        // 注册推送
-//        CMUMApiUtil.registerUMPush(launchOptions: launchOptions) { granted, _ in
-//            debugPrint("注册推送:\(granted ? "成功" : "失败")")
-//        }
-//        // 处理口令
-//        PQBoardCommandUtil.dealWithPasteboardData()
+        // 初始化友盟 61c3e145e0f9bb492ba6e4e4
+        registerUM(umAppkey: "61c3e145e0f9bb492ba6e4e4")
         // 冷热启动上报
         appLaunchReportUpload()
     }
 
+    class func registerUM(umAppkey: String, channel: String = "AppStore") {
+        #if DEBUG
+            UMConfigure.setLogEnabled(true)
+        #else
+            // 注册友盟
+            UMConfigure.setEncryptEnabled(true)
+            // 初始化友盟所有组件产品
+            UMConfigure.initWithAppkey(umAppkey, channel: channel)
+        #endif
+    }
+
     // 冷热启动上报
     class func appLaunchReportUpload(isHotLaunch: Bool = false) {
         // 冷启动

+ 6 - 0
Introduce/Record/Introduce-Bridging-Header.h

@@ -0,0 +1,6 @@
+//
+//  Use this file to import your target's public headers that you would like to expose to Swift.
+//
+
+#import <UMCommon/UMCommon.h>
+#import <UMCommon/MobClick.h>

+ 4 - 0
Podfile

@@ -9,6 +9,10 @@ source 'https://git.yishihui.com/iOS/BFSpecs.git'
 target 'Introduce' do
   #富文本库
   pod 'TYAttributedLabel','2.6.9'
+  pod 'UMCommon',                 '7.3.5'
+  pod 'UMDevice',                 '2.1.0'
+  pod 'UMCSecurityPlugins',       '1.0.6'
+  pod 'UMAPM',                    '1.5.5'
 
 ## Pods-for-AppStore
 #  pod 'BFCommonKit',           '1.4.9'