Is it possible to disable the automatic chat closure after a certain period of time for zendesk.chat on Android? | Community
Skip to main content

Is it possible to disable the automatic chat closure after a certain period of time for zendesk.chat on Android?

  • May 20, 2024
  • 0 replies
  • 0 views

Albert11

Good day,

I need a chat solution that will retain the entire message history from start to finish and will not automatically close due to inactivity. Based on the documentation and my requirements, Zendesk Messaging with JWT token authentication seems to be a suitable option. However, Messaging is not very flexible and does not allow for additional configurations. Example: 

zendesk.android.Zendesk.initialize(
           context = context,
           channelKey = "key",
           successCallback = {...},
           failureCallback = { cause ->...},
           messagingFactory = DefaultMessagingFactory()
)
zendesk.android.Zendesk.instance.loginUser(jwt, {
   zendesk.android.Zendesk.instance.messaging.showMessaging(
       context,
       Intent.FLAG_ACTIVITY_NEW_TASK
   )
   }, {...}
)

I also found zendesk.chat, which is more flexible in its settings and also supports JWT authentication, but the chat automatically closes after 5 minutes of inactivity, which is not acceptable for my situation. Example:

Chat.INSTANCE.init(context, zendeskConfig.chatAccountKey, zendeskConfig.applicationId)
Logger.setLoggable(true)
Chat.INSTANCE.setIdentity(jwtAuthenticator) {
   val chatConfiguration = ChatConfiguration.builder().build()
   val chatEngine = ChatEngine.engine()
   context.startActivity(
       MessagingActivity.builder()
           .withEngines(chatEngine)
           .intent(context, chatConfiguration)
           .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
   )
}

Is it possible to configure the chat to prevent automatic closure without explicit action, or is this not an option, making Zendesk Messaging for Android the only viable solution?