Recent searches


No recent searches

Android Push Notifications Issues



Posted Feb 01, 2024

Hi,
I am writing because we are finding some issues integrating the Android push notifications in the Zendesk messages. After following the instructions in https://developer.zendesk.com/documentation/zendesk-web-widget-sdks/sdks/android/push_notifications/ (we made the custom implementation of FirebaseMessagingService since we have other handlers in the app), we found out that notifications were not received. After some digging, it seems that the root cause is the fact that onNewToken is only invoked when the device token is invalid (normally because a new app install), but it is not invoked for existing users. So, in practice, for apps with pre-existing notifications, I believe it’s needed to add an extra step on the documentation, with something like:
FirebaseMessaging.getInstance().token.addOnSuccessListener(activity) { result ->
      PushNotifications.updatePushNotificationToken(token)
}
On top of that, now with that part of the code fixed, we are finding a second problem that we do not know how to resolve, and might require any assistance. When the app receives a push with a message, it can be in 3 states: foreground, background or killed. The first 2 states are handled properly, the use of
PushNotifications.displayNotification(context = this, messageData = remoteMessage.data)
handles a local notification that when clicked it redirects the user to the specific conversation in Zendesk by using a custom pending intent. However, when the app is in killed state, the notification management is different (the OS is the one showing the notification), and when user clicks the invoked method is a onNewIntent or onStart in the launch activity of the app, which is not handling the zendesk data and therefore does not open the conversation screen. How can we fix this? can we invoke any method in ZendeskSdk when we get the new intent so zendesk can inspect it and open the conversation accordingly?Thanks for the help

0

2

2 comments

Hello, is there any update on this matter?

0


image avatar

Erica Girges

Zendesk Developer Advocacy

Hey Giulio! 
 
I'm looking into this for you now. Will get back with you shortly once I've done some testing on my end.
 
All the best,
 

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post