-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathKochavaServiceAdapter.swift
64 lines (55 loc) · 1.83 KB
/
KochavaServiceAdapter.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import Foundation
/**
Adapter for the KochavaMeasurement framework.
# Useful links:
- https://support.kochava.com/sdk-integration/ios-sdk-integration/
- http://support.kochava.com/sdk-integration/ios-sdk-integration/ios-using-the-sdk/
# Package example:
```
// swift-tools-version: 5.10
import PackageDescription
let package = Package(
name: "Example",
platforms: [.iOS(.v13)],
dependencies: [
.package(name: "Tracker", path: "./swift-event-tracker"),
.package(url: "https://github.com/Kochava/Apple-SwiftPackage-KochavaMeasurement-XCFramework", from: "8.0.0"),
.package(url: "https://github.com/Kochava/Apple-SwiftPackage-KochavaNetworking-XCFramework", from: "8.0.0"),
],
targets: [
.target(
name: "Example",
dependencies: [
.product(name: "KochavaMeasurement", package: "Apple-SwiftPackage-KochavaMeasurement-XCFramework"),
.product(name: "KochavaNetworking", package: "Apple-SwiftPackage-KochavaNetworking-XCFramework"),
"Tracker"
]
)
]
)
```
# Integration example:
```
import KochavaMeasurement
import Tracker
struct KochavaAdapter: KochavaServiceAdapter {
func sendCustomEvent(name: String, infoDictionary: [AnyHashable : Any]?) {
KochavaMeasurement.Event.sendCustom(
eventName: name,
infoDictionary: infoDictionary
)
}
func registerIdentityLink(name: String, identifier: String?) {
IdentityLink.register(
name: name,
identifier: identifier
)
}
}
```
*/
// sourcery: AutoMockable
public protocol KochavaServiceAdapter {
func sendCustomEvent(name: String, infoDictionary: [AnyHashable : Any]?)
func registerIdentityLink(name: String, identifier: String?)
}