Skip to main content
Answered

User data is getting mixed up

  • June 12, 2023
  • 1 reply
  • 121 views

In the Android project I'm working on, we're noticing that user data is getting mixed up. Why could this be happening? Every time a user logs into the application, we perform a login to Intercom using the following code:

 

operator fun invoke(user: UserModel, intercomHash: String) {
    val userAttributes = createUserAttributes(user)
    val registration = Registration.create().withUserId(user.id)
    Intercom.client().setUserHash(intercomHash)
    Intercom.client().loginIdentifiedUser(registration, object : IntercomStatusCallback {
        override fun onFailure(intercomError: IntercomError) {
            /*
                The Intercom login will fail with error code 3002 if the user is already logged in.
             */
        }

        override fun onSuccess() {
            Intercom.client().updateUser(userAttributes)
        }
    })
}

private fun createUserAttributes(user: UserModel) = UserAttributes.Builder()
    .withEmail(user.person.emailAddress)
    .withPhone(user.person.phoneNumber)
    .withName(user.person.name.fullName)
    .withCustomAttribute(CUIT_CUIL, user.person.identification.cuitCuil)
    .withCustomAttribute(FIRST_NAME, user.person.name.firstName)
    .withCustomAttribute(LAST_NAME, user.person.name.lastName)
    .withCustomAttribute(EMAIL, user.person.emailAddress)
    .withCustomAttribute(DNI, user.person.identification.dni)
    .withCustomAttribute(TRACKING_ID, user.trackingId)
    .build()



And if the user unlinks their account, we use 

Intercom.client().logout()



Please note that we're using version 15.1.0 of the Intercom SDK.

Best answer by Racheal

Hey @JuanFraga Racheal from the support engineer team here👋 

 

We’ll need a bit more context here, such as user examples and what exactly is getting mixed up. I’ll go ahead and forward this conversation in to support. Keep an eye out for their response!

View original
Did this topic help you find an answer to your question?

1 reply

Racheal
Intercom Team
Forum|alt.badge.img+5
  • Customer Support Engineer
  • 512 replies
  • Answer
  • June 16, 2023

Hey @JuanFraga Racheal from the support engineer team here👋 

 

We’ll need a bit more context here, such as user examples and what exactly is getting mixed up. I’ll go ahead and forward this conversation in to support. Keep an eye out for their response!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings