SDK Error Logging (for iOS)

A new feature is being introduced in Zendrive SDK v9.0 - a heartbeat error logging feature that helps improve the reliability of the existing Heartbeat service.

How SDK Error Logging Helps Improve Heartbeat Reliability

If the customer application is not running, (either in the foreground or in the background), Zendrive backend sends a webhook to the client / application server, which in turn dispatches a silent push notification to the user. This silent notification wakes up the application in the background and allows it time (approximately 30 secs) to perform certain actions, such as collecting the SDK health data.

SDK Error Logging collects all changes or updates made to user permission state, records them and uploads them to the Zendrive Backend. These permission-state change lots are used by Zendrive backend for reporting and debugging purposes. This is done for both iOS and Android, irrespective whether the customer application is running in the foreground or in the background.

Silent Push Notifications

Silent push notifications help to gather heartbeat data when a user changes any critical permissions required to relaunch the application and collect data such as location permission or location service.

Also, if the user has not been taking trips for a very long period, silent push notifications help obtain the reason for lack of heartbeat data over the period. This reason could one of the following:

  • Change in user permissions.

  • Periodic or broken collection of heartbeat.

  • SDK set up issues.

  • Geofence breach

  • SDK teardown and others.

Background Processing

The Background Processing feature request the user device to launch the customer application in the background, and provides approximately 60 secs to perform some actions. Even if the user hasn't used the application in a week, Background Processing will open it. This feature has no effect on low power mode and battery level, since iOS will start the process when the device is connected to a charger.

Background Processing can handle the following tasks:

  • Collect heartbeat when user is not taking any trip, and the application is either killed or in suspended mode at-least once a day.

  • Upload the heartbeat once in a day.

SDK API Details API: logSDKHealth

In response to the silent push notification, the application backend fires new public API (logSDKHealth). This API logs all critical permissions, especially any permission updates since the last recorded SDK health.

  • @param sdkHealthReason: This API parameter indicates the reason for logging SDK Health.

  • @param completionHandler: This API parameter indicates the error pointer where Zendrive SDK will populate the error thrown by the method, such as when the SDK is not properly set up.

@objc public static func logSDKHealth(_ reason: ZendriveSDKHealthReason, completionHandler: @escaping (Error?) -> Void )

SDK Health Reason Schema

typedef NS_ENUM(int, ZendriveSDKHealthReason) {
     * Indicates the reason  is unknown. This is the default value.
    ZendriveSDKHealthReasonUnknown = 0,
     * Indicates the SDK health will recorded due to silent push notification
    ZendriveSDKHealthReasonSilentPushNotification = 1,
     * Indicates the SDK health will recorded due to background processing
    ZendriveSDKHealthReasonBackgroundProcessing = 2,
};

References

Was this helpful?