|
@@ -156,78 +156,18 @@ public class BFEventTrackAdaptor: NSObject {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /// 冷热启动数据上报
|
|
|
+
|
|
|
+ /// app冷热启动上报
|
|
|
/// - Parameters:
|
|
|
- /// - isHotLaunch 是否是热启动
|
|
|
- /// - logType: <#logType description#>
|
|
|
- /// - eventId: <#eventId description#>
|
|
|
- /// - eventData: <#eventData description#>
|
|
|
- /// - extParams: <#extParams description#>
|
|
|
- /// - pageSource: <#pageSource description#>
|
|
|
- /// - Returns: <#description#>
|
|
|
-// class public func reportStatisticsUpload(isHotLaunch: Bool = false, logType: statisticsLogType, coldLaunchType _: coldLaunchType = .coldLaunchType_userActiveOpen, eventId _: String?, eventData _: String?, pageSource: PAGESOURCE?) {
|
|
|
-// DispatchQueue.global().async {
|
|
|
-// var params: [String: Any] = ["LogType": logType.rawValue]
|
|
|
-// if PQSingletoMemoryUtil.shared.isColdLaunch {
|
|
|
-// // 1-请求中 2-请求成功 3-请求失败
|
|
|
-// if PQSingletoMemoryUtil.shared.coldLaunchStatus != 2 {
|
|
|
-// PQSingletoMemoryUtil.shared.coldLaunchStatus = 1
|
|
|
-// } else {
|
|
|
-// return
|
|
|
-// }
|
|
|
-// }
|
|
|
-// params["eventData"] = dictionaryToJsonString(["tabIndex": PQSingletoMemoryUtil.shared.selectedTabIndex ?? "categoryTab"])
|
|
|
-// // 参数
|
|
|
-// var extParams: [String: Any] = Dictionary<String, Any>.init()
|
|
|
-// extParams["downloadChannel"] = channelID
|
|
|
-// extParams["launchParams"] = PQSingletoMemoryUtil.shared.commandLaunchParams
|
|
|
-// if pageSource?.rawValue.contains("speedApp-category") ?? false {
|
|
|
-// params["pageCategoryId"] = 55
|
|
|
-// }
|
|
|
-// if PQSingletoMemoryUtil.shared.commandReportParams != nil {
|
|
|
-// for (key, value) in PQSingletoMemoryUtil.shared.commandReportParams!.reversed() {
|
|
|
-// extParams[key] = value
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if !isHotLaunch {
|
|
|
-// extParams["coldLaunchType"] = (PQSingletoMemoryUtil.shared.coldLaunchType ?? .coldLaunchType_userActiveOpen).rawValue
|
|
|
-// } else {
|
|
|
-// extParams["hotLaunchType"] = (PQSingletoMemoryUtil.shared.coldLaunchType ?? .coldLaunchType_userActiveOpen).rawValue
|
|
|
-// }
|
|
|
-// if pageSource != nil {
|
|
|
-// params["pageSource"] = pageSource!.rawValue
|
|
|
-// }
|
|
|
-// // 是否第一次安装
|
|
|
-// let firstInstall: String? = getUserDefaults(key: cFirstInstall) as? String
|
|
|
-// if firstInstall == nil || (firstInstall?.count ?? 0 <= 0) || firstInstall != "1" {
|
|
|
-// extParams["isFirstLaunch"] = 1
|
|
|
-// } else {
|
|
|
-// extParams["isFirstLaunch"] = 0
|
|
|
-// }
|
|
|
-// params["extParams"] = dictionaryToJsonString(extParams)
|
|
|
-// // 是否第一次安装
|
|
|
-// let firstParams: String? = getUserDefaults(key: cFirstParams) as? String
|
|
|
-// if (firstInstall == nil || firstInstall?.count ?? 0 <= 0 || firstInstall != "1") && (firstParams != nil && ((firstParams?.count ?? 0) > 0)) {
|
|
|
-// params = jsonStringToDictionary(firstParams!) ?? Dictionary<String, Any>.init()
|
|
|
-// }
|
|
|
-// if firstParams == nil || ((firstParams?.count ?? 0) <= 0) {
|
|
|
-// saveUserDefaults(key: cFirstParams, value: dictionaryToJsonString(params) ?? "")
|
|
|
-// }
|
|
|
-// BFNetRequestAdaptor.postRequestData(url: PQENVUtil.shared.commonapi + staticsFrontendReportUrl, parames: params,commonParams: commonParams()) { response, _, error, _ in
|
|
|
-// BFLog(message: "冷热启动上报:\(String(describing: error)),\(response ?? [:]),params = \(params)")
|
|
|
-// if PQSingletoMemoryUtil.shared.isColdLaunch {
|
|
|
-// PQSingletoMemoryUtil.shared.coldLaunchStatus = error == nil ? 2 : 3
|
|
|
-// }
|
|
|
-// // 清空启动数据
|
|
|
-// PQSingletoMemoryUtil.shared.coldLaunchType = nil
|
|
|
-// if error == nil, firstInstall == nil || firstInstall?.count ?? 0 <= 0 || firstInstall != "1" {
|
|
|
-// saveUserDefaults(key: cFirstInstall, value: "1")
|
|
|
-// }
|
|
|
-// saveUserDefaults(key: cSelectedTabIndex, value: "categoryTab")
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
+ /// - isFirstLaunch: <#isFirstLaunch description#>
|
|
|
+ /// - firstParams: <#firstParams description#>
|
|
|
+ /// - isHotLaunch: <#isHotLaunch description#>
|
|
|
+ /// - launchType: <#launchType description#>
|
|
|
+ /// - commonParams: <#commonParams description#>
|
|
|
+ class public func appLaunchReportUpload(isFirstLaunch: Int = 1, firstParams: [String: Any]? = nil, isHotLaunch: Bool = false, launchType: String = "userActiveOpen", commonParams: [String: Any]?) {
|
|
|
+ BFBaseEventTrack.appLaunchReportUpload(url: PQENVUtil.shared.commonapi + staticsFrontendReportUrl, isFirstLaunch: isFirstLaunch, firstParams: firstParams, isHotLaunch: isHotLaunch, launchType: launchType, commonParams: commonParams)
|
|
|
+ }
|
|
|
+
|
|
|
/// 推送点击数据上报
|
|
|
/// - Parameters:
|
|
|
/// - pushId: 推送Id
|