Custom Events for tvOS

Custom events enable you to better understand user behavior.

The following sections call out the differences in APIs between native apps and client-server apps, where applicable.

(Optional) Advanced Analytics features

a. Track application errors

Use this to log exceptions and/or errors that occur in your app. Flurry will report the first 10 errors that occur in each session.

For native apps:

For client-server apps:

Flurry.onError(errorId: string, message: string, errorClass: string);
Flurry.onError(errorId: string, message: string, errorClass: string, errorParams: { [key: string]: string; });

b. Track user demographics

After identifying the user, use this to log the user’s assigned ID, username, age and gender in your system.

Note

Per Flurry Terms of Service, you are not allowed to pass along unique device identifiers such as IDFA in this field.

For native apps:

For client-server apps:

Flurry.setUserId(userId: string);
Flurry.setAge(age: number);
Flurry.setGender(gender: string);

c. Track geographic location of your users

This allows you to set the current GPS location of the user. Flurry will keep only the last location information.

For native apps:

After starting the location manager, you can set the location with Flurry. You can implement CLLocationManagerDelegate to be aware of when the location is updated.

Below is an example of how to use this method after you have received a location update from the locationManager.

This allows you to set the current GPS location of the user. Flurry will keep only the last location information. If your app does not use location services in a meaningful way, using CLLocationManager can result in Apple rejecting the app submission.

For client-server apps:

flurrySetLocation({Number} latitude, {Number} longitude, {Number} horizontalAccuracy, {Number} verticalAccuracy)

d. Add session origin and attributes

This allows you to specify session origin and deep link attached to each session, or add a custom parameterized session parameters. You can also add an SDK origin specified by origin name and origin version.

For native apps:

For client-server apps:

Flurry.setSessionOrigin(originName: string, deepLink: string);
Flurry.addSessionProperty(name: string, value: string);
Flurry.addOrigin(originName: string, originVersion: string);
Flurry.addOrigin(originName: string, originVersion: string, originParameters: { [key: string]: string; });

e. Track App Store transactions

This allows you to automatically track App Store transactions.

For native apps:

For client-server apps:

Flurry.setIAPReportingEnabled(enableIAP: boolean);

(Optional) Configure when data is sent to Flurry

  • By default the SDK will send a partial session report once there are 10 events queued. Use this method below to change this default value. The minimum and maximum values are 5 and 50 respectively.:

    [Flurry setTVEventFlushCount:(short)count];
    
  • By default the SDK will send a partial session report once 5 minutes of session has elapsed. Use this method below to change this default value. The minimum and maximum values are 5 and 60 respectively.:

    [Flurry setTVSessionReportingInterval:(short)count];
    

Important

Partial session report is sent when either event flush count OR session reporting interval is reached.