We’re having an Intercom widget on all pages including unauthorized state. When users log in we call `update` with `user_id`, `email` and `name`. Widget is correctly updated, but if it was opened at least once for an unauthorized user then conversations are not refetched until the page is not reloaded in a browser. Though if you do not click a widget in unauthorized state and log in, then conversations will be fetched on widget click. Seems like `/messenger/web/conversations` API can be called only once which is confusing. Is it possible to refetch conversations after switching from visitor to a contact?
Hey there
To address the issue where conversations are not refetched after a user logs in, ensure that you properly shut down Intercom when a user's session ends. This can be done by calling Intercom('shutdown') when the user logs out.
This action clears the session and ensures that when a user logs in again, a fresh session is started, allowing conversations to be fetched correctly.
Additionally, if you are using a Single Page Application (SPA), consider calling the Intercom('update') method with new user data after login. This triggers the JavaScript to look for new messages for the current user and display them if they exist.
By implementing these steps, you should be able to refetch conversations after switching from a visitor to a contact.
Hope this helps 💪🏼
Hey
Intercom({ app_id: <app_id> })
It runs Intercom widget for a visitor (unauthorized user). Then when user id is fetched (meaning user is logged in) we run
update({ user_id: <user_id>, email: <email>, name: <name> })
which updates the session and the view of messenger changes.
When user logs out we call
shutdown();
boot(window.intercomSettings)
The issue is that it works correct only if user does not click the widget before call of update. If user clicks widget before update it sends /messenger/web/conversations and does not send it again after update
Hi
Could you write into us via the Messenger concerning this issue, there should be a bug report being submitted today regarding this issue.
Thanks!
Join the Intercom Community 🎉
Already have an account? Login
Login to the community
No account yet? Create an account
Intercom Customers and Employees
Log in with SSOEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.