Skip to main content
Answered

On iOS, when do we have to call setUserHash?

  • January 22, 2021
  • 4 replies
  • 207 views

I turned on Identity Verification and therefore need to set a user hash.

 

The documentation states this to set the User Hash:

  • When your iOS app initializes Intercom if the user is identified (i.e., you have a user id or email address), pass in a String of the HMAC returned from your server's authentication call. This should be called before any registration calls.

 

I looked at the Intercom iOS sample app here. I do see that registerUser is called in two places:

  1. On app launch inside of: AppDelegate/didFinishLaunchingWithOptions (Objective-C sample) or SceneDelegate/willConnectTo (Swift sample)
  2. On user tapping login: handleUserLogin

 

My question is: do I have to call setUserHash in both places as well? The documentation states I need to call setUserHash before any registration calls. I'm not sure if this means that I have to call it in both app launch and user tapping login.

 

Could someone please confirm when to call setUserHash?

Best answer by Anonymous

Hi @larry n​! You'll need to call setUserHash in both places 👍

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

4 replies

  • 0 replies
  • Answer
  • January 26, 2021

Hi @larry n​! You'll need to call setUserHash in both places 👍


  • Author
  • New Participant
  • 2 replies
  • January 26, 2021

Hi @[Mathew Cropper] (Intercom Employee)​! Thank you for answering!!! 🙏🙏

 

One follow up question, should setUserHash be called right before registerUser always? In the documentation here there is a part that states to call setUserHash before any registration calls. My assumption is that this means call setUserHash before registerUser in both places (app launch and user tapping login).

 

hash-2Is my assumption correct?


  • 0 replies
  • February 4, 2021

Yes, that's right. You'll need to do that every time.


  • Author
  • New Participant
  • 2 replies
  • February 10, 2021

Thank you Mathew! Appreciate the help!


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