Registering for Callbacks

Until now, you have set-up the Kruzr SDK, enabled it for trip detection and learnt which methods allow you to build your own custom actions on available Trip and Notification related methods.

In this section we will discuss the process of registering necessary Callbacks to implement methods discussed in the previous section.

Please take the following steps for each type of callback implementations.

Note: This should be added to your Application Class.

// if you want to receive trip related callbacks
Kruzr.getInstance().registerCallbackInterface(context, new MyTripCallbacks());

// if you want to receive notification click related callbacks
Kruzr.getInstance().registerCallbackInterface(context, new MyNotificationCallbacks());

MyTripCallbacks is the class implementing TripCallbackInterface and MyNotificationCallbacks is the class implementing NotificationClickCallbackInterface (which we implemented in previous section)

Congratulations! You have now made all necessary registrations and set-up required to start interacting with Kruzr SDK with your app.

Last updated