This library is part of the service ASATools
You can integrate ASATools using Cocoapods or Swift PM.
Add the following line to your Podfile:
target '<Your Target Name>' do
pod 'ASATools', '~> 1.4.0'
end
Then, run the following command:
pod install
To integrate ASATools into your Xcode project using Swift Package Manager, add it to the dependencies value of your Package.swift
:
dependencies: [
.package(url: "https://github.com/ASATools/ios_sdk.git", .upToNextMajor(from: "1.4.0"))
]
Open AppDelegate and at the top of the file add
import ASATools
From applicationDidFinishLaunching method call:
ASATools.instance.attribute(apiToken: "your_token_here")
To get your API token please visit ASATools dashboard.
If you want store attribution data or pass it to your product analytics, you can use AttributionResponse from completion block.
ASATools.instance.attribute(apiToken: "your_token_here") { response, error in
if let response = response {
// pass response.analyticsValues() to your product analytics
Amplitude.instance.setUserProperties(response.analyticsValues())
Amplitude.instance.logEvent("did_receive_asa_attribution", withEventProperties: response.analyticsValues())
}
}
Note, that completion block will only be called once if there is a success response.
vdugnist, [email protected]
ASATools is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 0 |
Last commit: 3 days ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics