Skip to main content

Integrating iOS SDK

Integrating the TestFairy SDK into your app helps you better understand how your app performs on real devices. It tells you when and how people are using your app, and provides you with any metrics you may need to optimize your user experience and code. You get to:

  • Track app use.
  • Handle crashes and report to server.
  • Record screen video and other metrics.
  • Understand user flow, using checkpoints.
  • Grab NSLogs from client and report to server.
  • Automatically update if a new build is available.

Adding the SDK

note

Requires Xcode 12+. Screenshots taken from Xcode 13.1

  1. Select your project from the Xcode navigator to open your project's configuration.
  2. Make sure your project is selected from Project and Target list.
  3. Click the Package Dependencies Toolbar item.
  4. Click the '+' icon to add a package.
  1. In the newly opened dialog search for the TestFairy package repository using the URL: https://github.com/testfairy/testfairy-ios-sdk-swift-package in the top right search bar.
  2. Click the Add Pacakge button.
  1. After the package has been downloaded, in the newly opened dialog, make sure the TestFairy package is selcted in the "Package Product" column
  2. Make sure the right target is selected in the "Add to target" column
  3. Click the Add Pacakge button

Initializing the SDK

  1. Open your AppDelegate.m file.

  2. Add this code to your app:

#import "TestFairy.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

[TestFairy begin:@"SDK-u6qN9qXN"];

// below of the rest of the didFinishLaunchingWithOptions method
// ...
}

Using PencilKit for Better Feedback

You can give your users a better set of tools to markup any screenshots provided during feedback by adding PencilKit to your project. Simply add the PencilKit.framework to your project.

note

This requires iOS 13 and Xcode 11.


Pencilkit

If a screenshot is attached to the feedback, your users can edit the screenshot by tapping on it and using PencilKit to mark it up.


Pencilkit Feedback