How to clear chat history when user logs out using the mobile SDK?

Using the mobile SDK (Android, and iOS) we are seeing the chat history fine.

But... when we log out of the app and log in with a different user the chat is still showing the history of the previous user.

Is there a way to clear the chat data when a user logs out so that we don't leak any chat history between accounts?

Thanks

Hey, just nudging to get a response to this.

Thanks

Hi Fogmeister,

Can you give some details on the login/logout process?
Are you using any authentication provider?

Thank you

Hi @tamasi878

No "r" in Fogmeister :smiley:

The log out process is one that we use with our own authentication provider separate from the Genesys chat.

The app requires users to log in to use the app. Then inside the app the user can tap a button to "Chat to us". At which point we instantiate the Genesys ChatController using the SDK as per the docs.

We are passing in some customAttributes to the messengerAccount when we create the chatController.

This has allowed the chat back end to authenticate the user and get information from the back end about the user.

But after the user logs out and a new user logs in those customAttributes change.

Something like this....

let messengerAccount = MessengerAccount(
    deploymentId: deploymentId,
    domain: domain,
    logging: loggingEnabled
)
messengerAccount.customAttributes = [
    "chatAgent": "mobile",
    "deviceDetails": "iOS",
    "userNumber": userNumber,
    "accountNumber": accountNumber,
]

chatController = ChatController(account: messengerAccount)

But when the chat is presented after a new user logs in. The chat history for the old number is visible.

Thanks

I'm sorry, I edited your name. :smiley:

Please check this section in the developer center, this is a generic explanation of Authenticated Messaging.
This will handle the different user logins and this is the next feature we will release this year.
Does it fit into your application?

The Clear Conversation feature will be delivered next year only, I don't have exact timeline yet for that.

Thanks @tamasi878

Thanks for the link. I think this is what the web team implemented on the web chat for the site.

When the authenticated messaging is implemented in the mobile SDK will this also mean that only the chat history of the authorised user is shown?

i.e. if user A logs in and starts chatting with support.
Then user A logs out.
Then user B logs in and starts chatting with support.
User B won't see user A's history?

Do you have an ETA for the authenticated messaging in the mobile SDK just so I can feedback to the team?

Thanks

Hi,

Yes, this is right. With authenticated messaging User B won't see the messages of User A in the explained scenario.

The ETA for the Authenticated Messaging on mobile is December 2024.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.