Recent searches
No recent searches
`hideMessaging()` to hide chat in messaging SDK
Posted Apr 29, 2024
Our Android app has several events that require us to log out users and close all activities.
E.g. when our access token expires, we need to log out user and show the login page per our InfoSec requirements.
Zendesk SDK has API to start messaging via showMessaging(), function but we can't find an option to hide the messaging chat. Can you guide us, what we can do here?
6
4 comments
Nika Meskhi
We also have the same issue and would appreciate to get an answer too
0
Erica Girges
Hi Anton and Nika!
For any UI customization outside of what's currently available, you can implement yourself by using the API providers. It's like using all of the functionality of the Zendesk SDK just minus our UI.
Hope this helps!
0
Alexandru Mogic
Please support this.
0
Alexandru Mogic
Got it to work by using a hacking workaround. I noticed in the logs that a new Activity for zendesk.messaging.android.internal.conversationscreen.ConversationActivity is created when showMessaging is called, so I catch that Activity on the MainApplication and switch it with the current activity so I can finish it later.
Step-by-Step Solution
Step 1: Modify the Application Class
Create a global variable to track the ConversationActivity and use ActivityLifecycleCallbacks to monitor its lifecycle events.
Step 2: Create a Utility Class to Manage Zendesk Messaging
Create a utility class that interacts with the application class to show and hide the Zendesk messaging.
Hope it helps!
PS: Zendesk please add support for easily hideMessaging the same way as we do for showMessaging
0