Integrate the 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.
-
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).
-
Select Plus (+) , and then select Choose Package Repository.
-
Paste the URL
https://github.com/Kount/kount-ios-swift-package
into the search bar, and then select Next. -
From Choose Package Options, 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.
-
-
Select Next.
-
From the Add Package to <project-name> prompt, select KountDataCollectorPackage.
-
Select 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.
How do I embed the Device Data Collector Swift Package into an existing Swift Package?
Complete the following steps if you are maintaining or updating a library and need to embed the Device Data Collector.
-
Open or create a Swift Package (e.g. ThirdPartyPackage).
-
Open
Package.swift
, and then under dependencies, add the following line:.package(name: “KountDataCollectorPackage”, url: “https://github.com/Kount/kount-ios-swift-package).
For example:
dependencies: [ // 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 the KountDataCollectorPackage dependency to the your Swift Package targets:
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. .target( name: "ThirdPartyPackage", dependencies: ["KountDataCollectorPackage"]), .testTarget( name: "ThirdPartyPackageTests", dependencies: ["ThirdPartyPackage"]), ]
-
Save and run your Package. The KountDataCollecorPackage is under the Swift Package Dependencies module for Xcode 12 or earlier and Package Dependencies for Xcode 13 or later.