v3rm0n / intercom_flutter

Flutter wrapper for Intercom libraries
95 stars 141 forks source link

User email is not showing on Intercom after loginIdentifiedUser(email: email) #484

Open AbdullahChauhan opened 1 week ago

AbdullahChauhan commented 1 week ago

Here's the steps currently I've implemented in my app but things are not working as expected:

  1. Initializing the user on app init
  2. After successful initialization, calling the loginUnidentifiedUser()
  3. When the user signed up in the app, calling the loginIdentifiedUser(email: user.email)
  4. Intercom dashboard still showing user id there
  5. No email updated in the user model after checking with fetchLoggedInUserAttributes()

Am I missing something here?

Plugin version: 9.2.0 Flutter version: 3.22.3

deepak786 commented 1 week ago

You cannot login again the user if the user is already logged in. To update the email after loginUnidentifiedUser, maybe you need to use updateUser API.

AbdullahChauhan commented 1 week ago

Hey @deepak786 Thanks for replying to my question.

No, we can't update the anonymous user. loginUnidentifiedUser --> updateUser

Error I'm getting: You cannot update the email of an anonymous user. Please call registerIdentified user instead. The email: test@xyz.com was NOT applied

AbdullahChauhan commented 1 week ago

@deepak786 So here's the updated flow I tested but still there's no email update on the Intercom chat USER DATA:

  1. Fresh user in the app -> loginUnidentifiedUser
  2. I can't call the updateUser because the user is currently anonymous
  3. User start chatting via messenger
  4. User appeared on the Intercom chat support with Random User id and identity similar toUser xxxx
  5. Now, user signed up in the app
  6. After successful sign up, immediately calling the loginIdentifiedUser with the user email. Note: I'm not calling the logout here before loginIdentifiedUser because I want to maintain the previous anonymous user chat history to this registered user
  7. Still no email update on the User data, strange!
  8. Even I called updateUser with user email after loginIdentifiedUser but still no email update!

Can you please try out these steps and let me know If something I'm still missing here!!!

Plugin version: 9.2.0 Flutter version: 3.24.5 Platform: Android

deepak786 commented 1 week ago

Then you need to check with the Intercom support team about how to convert an unidentified user to an identified user maintaining the chats.

AbdullahChauhan commented 1 week ago

@deepak786 Actually while shifting from anonymous to register user, the chat is maintaining but the problem is User email is not updating in the User data and since I'm calling loginIdentifiedUser(email: email) email should be updated in the Chat support!

deepak786 commented 1 week ago

It means yourloginIdentifiedUser(email: email) call is ignored as there is already a logged-in user (unidentified). So please check with the Intercom support team for solutions or alternatives.

AbdullahChauhan commented 1 week ago

Yeah, It seems like the call with the email is ignored because user is already registered with user id. Let's keep the issue open. I'll get back here after confirmation from the support. Thanks!