Skip to main content
Answered

Please provide an API to check logged in user


  • New Participant

This was requested multiple times here , but the topic was closed without a useful response.


In previous versions of the Intercom SDKs, logging in and out was idempotent: if we called login more than once with the same user ID (or log out more than once), it wouldn’t give any error. That’s no longer the case on the latest versions, and this presents a problem. 

The SDK persists the user’s login state between launches but doesn’t expose its user state, so the only way an app can avoid calling login with the same user details the next time the app runs (which would cause the SDK to throw an error), is by also persisting the user log in state via its own method, in hope of remaining in sync with the SDK’s login state. However, this is problematic: state persistence is error-prone, and if an error occurs with either the app’s or the SDK’s persistence, the two can get out of sync, and the SDK will throw an error and leave the app in an inconsistent state.

There are two options for the SDK to eliminate these risks, either :

  • make the login and logout calls idempotent once more, so that for example, calling login with the same user id as the current Intercom user does not throw an error, OR
  • make the currently logged in user’s user id / email available in the SDK, so that the app code knows when it can avoid calling login and logout unnecessarily.

Please give this feature request proper consideration.

Best answer by Eden

Hey @jpm 👋 Eden from the support engineer team here.

 

It looks like you wrote in about this question to the Support team, so that will be the best place to continue troubleshooting! I will update this thread when there is more insight to share on this as well. For the time being, can you try updating to the latest version of React Native and checking if this still occurs? We are currently on v6.2.0.

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

2 replies

  • New Participant
  • 3 replies
  • November 10, 2023

+1 For this issue. It’s been causing us headaches as well.


Eden
Employee
Forum|alt.badge.img
  • Premier Customer Support Engineer
  • 121 replies
  • Answer
  • November 16, 2023

Hey @jpm 👋 Eden from the support engineer team here.

 

It looks like you wrote in about this question to the Support team, so that will be the best place to continue troubleshooting! I will update this thread when there is more insight to share on this as well. For the time being, can you try updating to the latest version of React Native and checking if this still occurs? We are currently on v6.2.0.


Reply


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