Undefined user auto merge to identified user is not working | Community
Skip to main content

Hello everyone;

 

When the iOS app launches, we log in our Intercom user as an undefined user. Later, when the user log in or creates an account with a JWT token and we login them in as an identified user through Intercom, we can't see the undefined user's messages. When we try to send a message, we get an error.

 

I did the SDK integration correctly and the JWT token is working properly. But it's not automatically merging users' messages. How can I solve this problem?

 

SDK Version; 18.8.0

iOS: 18.4, 18.5


UI Error;

Something’s gone wrong

Couldn’t load the conversation
 

Intercom Request Error;

Path: https://<app-id>-ios.mobile-messenger.intercom.com/messenger/mobile/conversations/215469369303322

Code: 404

{
"type": "error.list",
"request_id": "004gb7n4n158kmpf4qeg",
"errors": "
{
"code": "not_found",
"message": "Resource Not Found"
}
]
}

 

 

Hi ​@Jarvis Roamless Paul here from weekend support engineering to help you out 🤝 

This issue happens because Intercom doesn’t automatically merge anonymous and identified users in the mobile SDK.

When you start with loginUnidentifiedUser() and later switch to loginIdentifiedUser() with a JWT, Intercom creates a new user profile, and the previous anonymous conversations become inaccessible — which causes the 404 you're seeing.

Use the Contacts Merge API to merge the anonymous user into the identified one after login:

POST /contacts/merge
{
"from": { "type": "user", "id": "anonymous_user_id" },
"into": { "type": "user", "user_id": "your_user_id" }
}

You can get the anonymous user’s ID from Intercom.getVisitorId() before switching sessions.

Let me know if you want help setting this up!


Reply