Integrate the Kount Device Data Collector Swift Package into your iOS application to collect additional end-user information. This assists in detecting suspicious devices and preventing fraud.
Software for this integration can be found in the GitHub repository.
Note: Swift Package Manager is available for Xcode version 12 or later.
Integrating the Swift Package Manager into an iOS Application
- Open your iOS application project, select the project, and then select the Swift Packages (for Xcode version 12 or earlier) or select Add Dependency (for Xcode version 13 or later).
- Click the Plus (+) button, and then Choose Package Repository.
- Paste the URL
https://github.com/Kount/kount-ios-swift-packageinto the search bar, and then click Next.
- From the Choose Package Options window, depending on your Xcode version, select Version, Exact Version, or Branch.
- For Version (or Exact Version), select the current version of the SDK.
- For Branch, select master branch.
- Click Next.
- From the Add Package to <project-name> prompt, select KountDataCollectorPackage.
- Click Finish.
Go to Project Navigator and verify that the KountDataCollectorPackage is shown in the Swift Package Dependencies module for Xcode 12 or earlier and in Package Dependencies for Xcode 13 or later.
Once you have added the KountDataCollector to your project, continue to the second step (runtime DDC invocation).
- For Swift invocation, refer to How to Invoke the Device Data Collector from a Swift App using iOS SDK 4.1.x.
Frequently Asked Questions
How do I embed the Kount DDC Swift Package into an existing Swift Package?
If you are maintaining/updating a library and need to embed the Kount DDC, complete the following steps:
- Open or create a Swift Package (e.g. ThirdPartyPackage).
Package.swift, and then under dependencies, add the following line:
.package(name: “KountDataCollectorPackage”, url: “https://github.com/Kount/kount-ios-swift-package).Example:
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(name: "KountDataCollectorPackage", url: "https://github.com/Kount/kount-ios-swift-package", from: "4.1.6")
- Add KountDataCollectorPackage dependency to the your Swift Package targets:
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
Save and run your Package. The KountDataCollecorPackage can be seen under the Swift Package Dependencies module for Xcode 12 or earlier and Package Dependencies for Xcode 13 or later.