HockeySDK-tvOS

Version 5.1.0

Introduction

HockeySDK-tvOS implements support for using HockeyApp in your tvOS applications.

The following features are currently supported:

Collect crash reports: If your app crashes, a crash log with the same format as from the Apple Crash Reporter is written to the device’s storage. If the user starts the app again, he is asked to submit the crash report to HockeyApp. This works for both beta and live apps, i.e. those submitted to the App Store.

User Metrics: Understand user behavior to improve your app. Track usage through daily and monthly active users, monitor crash impacted users, as well as customer engagement through session count. You can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal.

Update notifications: The app will check with HockeyApp if a new version for your Ad-Hoc or Enterprise build is available. If yes, it will show an alert view with informations to the moste recent version.

Authenticate: Identify and authenticate users of Ad-Hoc or Enterprise builds

2. Setup

2.1 Obtain an App Identifier

Please see the [How to create a new app](http://support.hockeyapp.net/kb/about-general-faq/how-to-create-a-new-app) tutorial. This will provide you with an HockeyApp-specific App Identifier to be used to initialize the SDK.

2.2 Download the SDK

Unzip the file. You will see a folder named HockeySDK-tvOS. (Be sure not to use 3rd-party unzip tools!)

2.3 Copy the SDK into your project directory in Finder

Move the unzipped HockeySDK-tvOS folder into your project directory. In our experience, most projects will have a directory specifically set aside for 3rd-party libraries. These instructions assume that your project has such a directory, and that it is called Vendor.

2.4 Set up the SDK in Xcode

We recommend creating a group in your Xcode project for 3rd-party libraries, similar to the structure of the files on disk. In this case, the group will be called Vendor, matching the directory.

Make sure the Project Navigator is visible (⌘+1)

Drag & drop HockeySDK.framework from your window in Finder (this would be the Vendor directory) into your project in Xcode, and move it to the desired location in the Project Navigator (e.g., into the group called Vendor)

A sheet will appear. Select Create groups for any added folders, and check the checkbox for your target. Be sure to select your tvOS target if you have more than one. Now click Finish.

2.5 Integrate the SDK into your code

Objective-C

Open the file containing your app delegate (AppDelegate.m in a default project).

Add the following line below your own import statements:

@importHockeySDK;

In the method application:didFinishLaunchingWithOptions:, add the following lines to initialize and start the HockeySDK:

Open the file containing your app delegate (AppDelegate.swift in a default project).

Add the following line below your own import statements:

importHockeySDK

In the method
application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool,
add the following lines to initialize and start the HockeySDK:

BITHockeyManager.shared().configure(withIdentifier:appId)BITHockeyManager.shared().start()BITHockeyManager.shared().authenticator.authenticateInstallation()// This line is obsolete in the crash only builds

Note: The SDK has been optimized to defer as much initialization as it can until needed, while still making sure that crashes on startup can be caught. Each module executes other code with a delay of up to several seconds. This ensures that your startup method will execute as fast as possible and that the SDK will not block the launch process (which would be a poor user experience and potentially result in your app being killed by the system watchdog process).

2.6 Bitcode

3. Advanced Setup

3.1 Setup with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like HockeySDK in your projects. To learn how to setup CocoaPods for your project, visit the official CocoaPods website.

Podfile

platform:tvos,'10.0'pod'HockeySDK-tvOS'

3.2 Crash Reporting Features

As the current release we provide is an beta version, crash reporting currently has limited configuration and fine-tuning options.

3.2.1 Disable Crash Reporting

The HockeySDK enables crash reporting by default. Crashes will be immediately sent to the server the next time the app is launched.

3.2.2 How are crash reports sent to HockeyApp?

Crashes are sent the next time the app starts, without any user interaction.

The SDK avoids sending the reports at the time of the crash, as it is not possible to implement such a mechanism safely. In particular, there is no way to do network access in an async-safe fashion without causing a severe drain on the device’s resources, and any error whatsoever creates the danger of a double-fault or deadlock, resulting in losing the crash report entirely. We have found that users do relaunch the app, because most don’t know what happened, and you will receive the vast majority of crash reports.

Sending pending crash reports on startup is done asynchronously, using NSURLSession. This avoids any issues with slow startup and is resilient against poor network connectivity.

3.3 User Metrics

HockeyApp automatically provides you with nice, intelligible, and informative metrics about how your app is used and by whom.

Sessions: A new session is tracked by the SDK whenever the containing app is restarted (this refers to a ‘cold start’, i.e. when the app has not already been in memory prior to being launched) or whenever it becomes active again after having been in the background for 20 seconds or more.

Users: The SDK anonymously tracks the users of your app by creating a random UUID that is then securely stored in the tvOS keychain. Because this anonymous ID is stored in the keychain it persists across reinstallations.

Custom Events: With HockeySDK 4.1.0 and later you can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal.

Just in case you want to opt-out of the automatic collection of anonymous users and sessions statistics, there is a way to turn this functionality off at any time:

Objective-C

[BITHockeyManagersharedHockeyManager].disableMetricsManager=YES;

Swift 3

BITHockeyManager.shared().isMetricsManagerDisabled=true

3.3.1 Custom Events

By tracking custom events, you can now get insight into how your customers use your app, understand their behavior and answer important business or user experience questions while improving your app.

Before starting to track events, ask yourself the questions that you want to get answers to. For instance, you might be interested in business, performance/quality or user experience aspects.

Name your events in a meaningful way and keep in mind that you will use these names when searching for events in the HockeyApp web portal. It is your reponsibility to not collect personal information as part of the events tracking.

3.4 In-App-Update notifications (Beta & Enterprise only)

The following options only show some of possibilities to interact and fine-tune the update feature when using Ad-Hoc or Enterprise provisioning profiles. For more please check the full documentation of the BITUpdateManager class in our documentation.

The feature presents update and version information in pop over window.

This module automatically disables itself when running in an App Store build by default!

4. Documentation

5.Troubleshooting

iTunes Connect rejection

Make sure none of the following files are copied into your app bundle. This can be checked by examining the Copy Bundle Resources item in the Build Phases tab of your app target in the Xcode project, or by looking within the final .app bundle after making your build:

HockeySDK.framework (unless you’ve built your own version of the SDK as a dynamic framework - if you don’t know what this means, you don’t have to worry about it)

de.bitstadium.HockeySDK-tvOS-5.1.0.docset

Features not working as expected

Enable debug output to the console to see additional information from the SDK as it initializes modules, sends and receives network requests, and more, by adding the following code before calling startManager:

6.2 Code of Conduct

6.3 Contributor License

You must sign a Contributor License Agreement before opening a pull request. To complete the Contributor License Agreement (CLA), you must submit a request via this form, then electronically sign the CLA once you receive the email containing the link to the document. Signing the CLA once, for any project, covers all submissions to all Microsoft OSS projects, unless otherwise noted.

7. Contact

If you have further questions or run into trouble that cannot be resolved by any of the information here, feel free to open a Github issue, or contact us at support@hockeyapp.net.