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:

  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

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