|
@@ -33,10 +33,16 @@ class INAppConfigUtil: NSObject {
|
|
|
class func applicationConfig(launchOptions _: [UIApplication.LaunchOptionsKey: Any]?) {
|
|
|
// 初始化友盟 61c3e145e0f9bb492ba6e4e4
|
|
|
registerUM(umAppkey: "61c3e145e0f9bb492ba6e4e4")
|
|
|
+ // 初始化Bugly
|
|
|
+ registerBugly(appID: "80af5e913c", deviceId: getMachineCode())
|
|
|
// 冷热启动上报
|
|
|
appLaunchReportUpload()
|
|
|
}
|
|
|
|
|
|
+ /// 初始化友盟
|
|
|
+ /// - Parameters:
|
|
|
+ /// - umAppkey: <#umAppkey description#>
|
|
|
+ /// - channel: <#channel description#>
|
|
|
class func registerUM(umAppkey: String, channel: String = "AppStore") {
|
|
|
#if DEBUG
|
|
|
UMConfigure.setLogEnabled(true)
|
|
@@ -48,6 +54,30 @@ class INAppConfigUtil: NSObject {
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
+ /// 初始化Bugly
|
|
|
+ /// - Parameters:
|
|
|
+ /// - appID: <#appID description#>
|
|
|
+ /// - channel: <#channel description#>
|
|
|
+ /// - deviceId: <#deviceId description#>
|
|
|
+ class func registerBugly(appID: String, channel: String = "AppStore", deviceId: String? = nil) {
|
|
|
+ let versionName = "\(Bundle.main.infoDictionary?["CFBundleShortVersionString"] ?? "1.0.0")"
|
|
|
+ // 注册bugly
|
|
|
+ let buglyConfig = BuglyConfig()
|
|
|
+ buglyConfig.reportLogLevel = .warn
|
|
|
+ #if DEBUG
|
|
|
+ buglyConfig.version = versionName + ".6666"
|
|
|
+ buglyConfig.debugMode = true
|
|
|
+ #else
|
|
|
+ buglyConfig.version = versionName + "." + versionCode
|
|
|
+ #endif
|
|
|
+ buglyConfig.channel = channel
|
|
|
+ buglyConfig.deviceIdentifier = deviceId ?? ""
|
|
|
+ buglyConfig.unexpectedTerminatingDetectionEnable = true
|
|
|
+ buglyConfig.blockMonitorEnable = true
|
|
|
+ buglyConfig.blockMonitorTimeout = 2
|
|
|
+ Bugly.start(withAppId: appID, config: buglyConfig)
|
|
|
+ }
|
|
|
+
|
|
|
// 冷热启动上报
|
|
|
class func appLaunchReportUpload(isHotLaunch: Bool = false) {
|
|
|
// 冷启动
|