12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //
- // FMTrackEventManager.swift
- // PDF Reader Pro
- //
- // Created by liujiajie on 2024/2/7.
- //
- import Foundation
- let kTrackEventManager = FMTrackEventManager.defaultManager
- @objcMembers class FMTrackEventManager: NSObject{
- static let defaultManager: FMTrackEventManager = {
- let manager = FMTrackEventManager()
-
- return manager
- }()
-
- override init() {
- super.init()
- }
-
- func trackEvent(event: String, withProperties properties: [String: String]?) {
- if event.count < 1 { return }
- #if DEBUG
- let keyStr: String = properties?.keys.first ?? ""
- let vStr: String = properties?.values.first ?? ""
- NSLog("###-FireBaseEvent-(%@)-properties(%@):(%@)",event,keyStr,vStr)
- #endif
-
- }
-
- func trackOnceEvent(event: String, withProperties properties: [String: String]?) {
- if event.count < 1 { return }
- var eventString = event
- if properties?.keys.count ?? 0 > 0 && properties?.values.count ?? 0 > 0 {
- var keyString = ""
- for key in properties!.keys {
- keyString += key
- }
- for value in properties!.values {
- keyString += value
- }
- eventString += keyString
- }
-
- }
-
- }
|