How to Integrate the Device Data Collector Swift Package Manager into an iOS Application

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.

Integrating the Swift Package Manager into an iOS Application

  1. 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).

  2. Select Plus (+) , and then select Choose Package Repository.

  3. Paste the URL https://github.com/Kount/kount-ios-swift-package into the search bar, and then select Next.

  4. From Choose Package Options, depending on your Xcode version, select Version, Exact Version, or Branch.

    1. For Version (or Exact Version), select the current version of the SDK.

    2. For Branch, select master branch.

  5. Select Next.

  6. From the Add Package to <project-name> prompt, select KountDataCollectorPackage.

  7. Select Finish.

Integration Verification

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).

Frequently Asked Questions

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.

  1. Open or create a Swift Package (e.g. ThirdPartyPackage).

  2. 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")
    
        ],
  3. 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"]),
    
        ]
  4. 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.

Was this article helpful?
0 out of 0 found this helpful