Hello!
I'm using classic chat sdk zendesk-chat = { module = "com.zendesk:chat", version = "3.4.0" }.
I initialise the SDK like this:
fun init() {
Chat.INSTANCE.init(applicationContext, accountKey)
val jwtAuthenticator = JwtAuthenticator { jwtCompletion ->
jwtCompletion.onTokenLoaded(userJwtToken) // I get userJwtToken from our server
}
Chat.INSTANCE.setIdentity(jwtAuthenticator) { retrievePushTokenFromFirebase() }
}
fun retrievePushTokenFromFirebase() {
val pushProvider: PushNotificationsProvider =
Chat.INSTANCE.providers()?.pushNotificationsProvider()
FirebaseMessaging.getInstance().token.addOnCompleteListener { task ->
if (task.isSuccessful) {
pushProvider?.registerPushToken(task.result)
}
}
}When a user logs in to the app and start a chat, the chat works well, but if the user closes MessagingActivity or switch an application, pushes do not come. I can see it in app's logs that there come a message (not push) and the chat state is INITIALIZING. No pushes come to my implementation of FirebaseMessagingService at this moment.
After the application is restarted, by the user or because being killed by the system, pushes start to come and work perfectly well.
I think there is a bug on the SDK side.