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:

flurryLogError({String} eventName, {String} message, {object} error)
  error -> { errorDomain: {String}, errorID: {Number}, userInfo: {object}}

b. Track user ID

After identifying the user, use this to log the user’s assigned ID or username 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:

flurrySetUserID({String} userID)

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)

5. (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.

  • This option is disabled by default. When enabled, Flurry will not finish the session if the app is paused for longer than the session expiration timeout. The session report will not be sent when the application is paused and will only be sent when the application is terminated. This allows for applications that run in the background to keep collecting events data. The time application spends in the background contributes to the length of the application session reported when the application terminates.:

    [Flurry setBackgroundSessionEnabled:(BOOL)backgroundSessionEnabled];