-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathHeapServiceProvider.swift
40 lines (30 loc) · 1.09 KB
/
HeapServiceProvider.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import Foundation
public final class AppsFlyerServiceProvider: AbstractProvider, Service {
public var supportedTags: [Tag] = [.appsFlyer, .analytics, .nativeEventParameters, .nativeProperties, .nativeUserId]
public override var trackingDisabled: Bool { adapter.isStopped }
private let adapter: AppsFlyerServiceAdapter
public init(adapter: AppsFlyerServiceAdapter) {
self.adapter = adapter
}
public func trackEvent(_ event: Event) {
adapter.logEvent(event.name, withValues: event.parameters)
}
public func setUserId(_ userId: String) {
adapter.customerUserID = userId
}
public func resetUserId() {
adapter.customerUserID = nil
}
public func setProperty(_ key: String, value: String) {
userProperties[key] = value
adapter.customData = userProperties
}
public func resetProperties() {
userProperties = [:]
adapter.customData = userProperties
}
public override func disableTracking(_ flag: Bool) {
super.disableTracking(flag)
adapter.isStopped = flag
}
}