// // KMAnalytics.swift // PDF Reader Pro // // Created by tangchao on 2023/7/12. // import Cocoa import AppCenter import AppCenterAnalytics import AppCenterCrashes import FirebaseCore import FirebaseAnalytics // 数据埋点 工具类 @objc class KMAnalytics: NSObject { public struct AppTarget: OptionSet, Codable { let rawValue: Int public static var free = AppTarget(rawValue: 1 << 0) public static var pro = AppTarget(rawValue: 1 << 1) public static var dmg = AppTarget(rawValue: 1 << 2) public static var all: AppTarget = [.free, .pro, .dmg] } // 配置 static func configure() { //#if DEBUG //#if VERSION_FREE //#if VERSION_DMG // let appSecret = "fb9d37aa-e3f2-4969-bd06-f65ce529a565" //#else // let appSecret = "8c08296d-ca5c-44da-b68a-b4382f119b1f" //#endif //#else // let appSecret = "54212f10-3ac9-42d9-96c0-5387f4b78d30" //#endif // AppCenter.start(withAppSecret: appSecret, services: [Analytics.self, Crashes.self]) //#else //// #if VERSION_DMG //// AppCenter.start(withAppSecret: "416b8e45-69bd-4a16-8fec-b5206e913c4a", services: [Analytics.self, Crashes.self]) //// #else //// AppCenter.start(withAppSecret: "f0d082d0-9581-458c-9069-7aaf0a2b0a8c", services: [Analytics.self, Crashes.self]) //// #endif #if VERSION_FREE #if VERSION_DMG let appSecret = "f2ea5307-b7be-468b-beda-a17ee458e182" #else let appSecret = "" #endif #else let appSecret = "" #endif if appSecret.isEmpty == false { AppCenter.start(withAppSecret: appSecret, services: [Analytics.self, Crashes.self]) } // FirebaseApp.configure() #if DEBUG // var newArguments = ProcessInfo.processInfo.arguments // newArguments.append("-FIRDebugEnabled") // ProcessInfo.processInfo.setValue(newArguments, forKey: "arguments") #endif } }