Webhook API
Hello,
We are using the push notification feature from the Support SDK on frontend and Webhook API on frontend in order to send users notification when we reply to their tickets.
Everything works fine except that when I unregister and register again, replies notifications for existing tickets stop to arrive. We checked and we are not getting the notification in our server from the Webhook API.
Here is how I am registering (using user id) and un registering.
fun registerForZendeskPushNotification() {
val userId = UserPreferences.getUserId()
if(!userId.isNullOrEmpty())
{
Zendesk.INSTANCE.provider()!!.pushRegistrationProvider()
.registerWithDeviceIdentifier(userId, object : ZendeskCallback<String?>() {
override fun onSuccess(result: String?) {
Timber.i("Zendesk Push Registration Success. Result = $result")
}
override fun onError(errorResponse: ErrorResponse) {
Timber.i("Zendesk Push Registration Failure. Reason = ${errorResponse.reason}")
}
})
}else{
Timber.i("userId is NULL or Empty.")
}
}
fun unregisterFromZendeskPushNotification() {
Zendesk.INSTANCE.provider()!!.pushRegistrationProvider().unregisterDevice(object : ZendeskCallback<Void?>() {
override fun onSuccess(response: Void?) {
Timber.i("Zendesk Push UnRegistration Success.")
}
override fun onError(errorResponse: ErrorResponse) {
Timber.i("Zendesk Push UnRegistration Failure. Reason = ${errorResponse.reason}")
}
})
}
When calling unregisterFromZendeskPushNotification() then registerForZendeskPushNotification() notifications stop top arrive.
P.S. It is working fine on IOS.
Please sign in to leave a comment.
0 Comments