Telemetry data lets you track how your users are interacting with your app. For instance, you can see where users are spending most of their time, or determine which types of challenges are the most engaging to users based on a few metrics.

By default, telemetry data is recorded for the following events out of the box:

requestFetchedWhen the method getRequestByGuid() is called.
requestProcessedWhen a challenge request is acted upon by a user.
notificationRecievedWhen the method handlePrivakeyNotification() is called.

In addition to these, there are optional telemetry events. These require additional external library calls:

notificationClickedWhen the method requestNotificationActedOn() is called. To send this event, be sure to call this method when a user taps a Privakey request notification. Typically, from the app delegate's func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) method.
requestViewedWhen the methods requestViewStart() and requestViewEnd() are called together.

Call requestViewStart() when the request has begun to be displayed to the user. Call requestViewEnd() when the request goes off screen. An event will be created that tracks how long the request was viewed.

If you would like to send custom telemetry events you can use the library method recordTelemetry.

let privakeyCX = PrivakeyCX()

let event = TelemetryEvent(event: "CustomEvent", attributes: ["someKey": "someValue"])

privakeyCX.recordTelemetry(telemetry: event) { success, error in }