Recent searches
No recent searches
How to clear / delete conversation for anonymous user within the iOS SDK
Posted Jan 03, 2024
We are looking for a way to clear or delete a conversation for an anonymous user within the iOS SDK. The current problem we are having is that once a user has started a chat and it has been escalated to an agent, that chat is never cleared on the device so a user cannot start a new conversation. The only real way we have found to achieve this is to uninstall and reinstall the mobile app.
Here are some of the solutions we have tried:
- Manually calling the [Smooch destroy] method when closing the chat
- Moving the [Smooch initWithSettings:completionHandler] function out of the [application:didFinishLaunchingWithOptions] and into our function that calls [Smooch show] in hopes completely reinitializing would help, but it did not.
We also found references to calling the Delete Messages API, but that does appear to be part of the iOS SDK. It was even mentioned on this github issue that it is not supported (https://github.com/zendesk/sunshine-conversations-ios/issues/189#issuecomment-370417212).
Additionally, we looked into logging a user in and back out but are unsure how to proceed with this approach to test if it would solve our problem. The iOS SDK requires a JWT and User ID, which are not currently using anywhere else. All of our conversations are done via anonymous user so this may not be what we are trying to achieve regardless.
Are there any ways we can completely clear chat history so when we call [Smooch show] it is starting a fresh conversation?
0
2 comments
Christopher Kennedy
Logging out or switching the the current user is the way to clear the conversation. Can you share any issues you've encountered with this approach?
0
College Ave Student Loans
Hi Christopher,
Thanks for the response. Our follow-up question is: Does user-id matter? Do we need to generate a unique id every time we call this or could we use the same one each time?
0