Custom
If for some reason, you need to implement your own dispatcher, you must create a BatchEventDispatcher
and register it to the SDK using Batch.EventDispatcher.addDispatcher(BatchEventDispatcher)
.
class MyKotlinApplication : Application(), BatchEventDispatcher {
override fun onCreate() {
super.onCreate()
Batch.start("MY_API_KEY")
registerActivityLifecycleCallbacks(BatchActivityLifecycleHelper())
// [...]
Batch.EventDispatcher.addDispatcher(this)
}
override fun dispatchEvent(type: Batch.EventDispatcher.Type,
payload: Batch.EventDispatcher.Payload) {
Log.d("Dispatcher", "I'm dispatching : " + type.name)
}
}
Last updated
Was this helpful?