Skip to main content

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?

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


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?


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


Thank you Mathew! Appreciate the help!


Reply