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

XCFramework is a type of binary library package that allows you to use third-party libraries in your iOS 11 or later applications. The Device Data Collector XCFramework package can simplify integrating the Device Data Collector into your app. XCFramework packages can be integrated directly into an app that does not use a package manager or uses the Swift Package Manager.

Adding the Device Data Collector XCFramework Package Directly

  1. Navigate to the Device Data Collector iOS SDK on GitHub, and then download the kount-ios-sdk project.

  2. In the XCode navigator, select File, then Add Files to your Project.

  3. In the kount-ios-sdk project, select KountDataCollector.xcframework.

  4. Select Copy items if needed and Create groups, and then select Add.

  5. Add the folder for touch events under project target.

    1. Go to the Xcode navigator, select File, and then select Add Files to your Project.

    2. In the kount-ios-sdk project, select KountDataCollectorUniversalLibrary.

    3. Under KountDataCollectorUniversalLibrary, select TouchControls.

    4. Select Copy items if needed and Create groups and then select Add.

For Swift applications:

You can create a bridging -header file or import the SDK directly into the Swift file.

  • Create a bridging-header file

    1. Create a bridging-header file, and then add the following code to the file:

          #import “KDataCollector.h”
          #import "KountAnalyticsViewController.h"
          
    2. In the target build settings, open Swift Compiler > General > Objective-C Bridging Header and then add:

      <project-name>-Bridging-Header.h
  • Import the SDK

    Import the SDK into the appropriate Swift file, such as AppDelegate or SceneDelegate.

    import KountDataCollector

To validate the framework has been added to your project:

  1. In the project navigator, open your project settings.

  2. Select your target, and then open the General tab.

  3. Go to Frameworks > Libraries > Embedded Content settings.

  4. On the newly-added KountDataCollector.xcframework, select Embed and Sign.

  5. If you don’t see KountDataCollector.xcframework, add it manually.

    1. Select Plus (+) .

    2. Select the KountDataCollector.xcframework.

    3. Select Add.

Once you have added the KountDataCollector to your project, continue to the second step (runtime implementation).

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