Intercom iOS push: "Failed to register a device token -identity verification is not setup correctly" when using Expo + @intercom/intercom-react-native | Community
Skip to main content

I’m trying to integrate Intercom push notifications into my React Native app built with Expo (using a custom dev client). I’m using @intercom/intercom-react-native (latest version) and JWT authentication.

I can successfully:

  • Generate a valid JWT (confirmed via jwt.io) with user_id and email.
  • Log in the user in Intercom with matching userId and email.
  • Verify that Intercom.isUserLoggedIn() returns true.
  • Fetch the logged-in user attributes from Intercom, which match the JWT payload.


Here’s the code I’m using to set up push notifications:

 

export const setupIntercomPushNotifications = async (): Promise<boolean> => {
  try {
    const { status: existingStatus } = await Notifications.getPermissionsAsync();
    let finalStatus = existingStatus;

    if (existingStatus !== "granted") {
      const { status } = await Notifications.requestPermissionsAsync();
      finalStatus = status;
    }

    if (finalStatus !== "granted") {
      console.log("❌ Push notification permissions not granted");
      return false;
    }

    // Get device token (native token, not Expo token)
    const { data: deviceToken } = await Notifications.getDevicePushTokenAsync();
    if (!deviceToken) {
      console.error("❌ Failed to get device push token");
      return false;
    }

    const isLoggedIn = await Intercom.isUserLoggedIn();
    console.log("🚀 ~ setupIntercomPushNotifications ~ isLoggedIn:", isLoggedIn);
    if (!isLoggedIn) {
      console.error("❌ User is not logged in to Intercom");
      return false;
    }

    const loggedInUser = await Intercom.fetchLoggedInUserAttributes();
    console.log("🚀 ~ setupIntercomPushNotifications ~ loggedInUser:", loggedInUser);

    // Send token to Intercom
    await Intercom.sendTokenToIntercom(deviceToken);
    console.log("✅ Device token successfully sent to Intercom");
    return true;
  } catch (error) {
    console.error(
      "❌ Error setting up Intercom push notifications:",
      JSON.stringify(error, null, 2)
    );
    return false;
  }
};


But when I call Intercom.sendTokenToIntercom(deviceToken), I consistently get this error on iOS:

ERROR - Failed to register a device token - identity verification is not setup correctly code: 302 domain: IntercomSDKErrorDomain NSLocalizedDescription: ERROR - Failed to register a device token - identity verification is not setup correctly


Additional details:

  • Using Expo Dev Client on a real iOS device.
  • APNs .p8 key has been uploaded to Intercom.
  • App bundle ID matches the one configured in Intercom.
  • JWT payload includes user_id and email, and expiration is valid.
  • Intercom login works fine (isLoggedIn: true and attributes match).
  • deviceToken returned from getDevicePushTokenAsync() looks valid


My question: Why would Intercom reject the device token with "identity verification is not setup correctly" even though JWT login is working?

Hey ​@qwert123 Paul here from support engineering to help you out 🤝 

I can see Intercom is logging the user in, but push token registration needs a verified mobile session. On iOS this requires either logging in with a mobile JWT signed using your iOS Mobile Identity Verification secret or logging in with identifiers plus a userHash derived from the same secret.
Please switch your login to Intercom.loginUserWithJwt(yourMobileJwt) (signed with the iOS secret), then call sendTokenToIntercom. Alternatively, if you prefer identifier login, set userHash from your server before login. After this change, the 302 identity error will stop and push registration will succeed.

 

Can you:

  1. Call Intercom.logout().

  2. Call Intercom.loginUserWithJwt(<JWT signed with iOS Mobile secret>).

  3. Confirm await Intercom.isUserLoggedIn() prints true.

  4. Call await Intercom.sendTokenToIntercom((await Notifications.getDevicePushTokenAsync()).data).
    Expected: no 302 error; token registered.

If you still see 302, collect for me:

  • The exact login method used (code snippet).

  • The JWT header & payload (no secret), especially alg, user_id, exp.

  • Confirmation of which Intercom secret was used (Web vs iOS Mobile).

  • App restart + logout logs to rule out a stale session.


Hello ​@Paul Byrne 

Thank you for the response.

I have already tried the suggested steps, I still get the same error (302).

 

This is how I log the user in
 


// Set JWT token for secure authentication
await Intercom.setUserJwt(intercomJwt);

// Login user with secure authentication
await Intercom.loginUserWithUserAttributes({
userId: user.id,
email: user.email,
name:
user.firstname && user.lastname
? `${user.firstname} ${user.lastname}`
: user.email,
customAttributes: {
platform: "mobile",
},
});

 

The JWT header 

{
"alg": "HS256",
"typ": "JWT"
}

And payload

 

{
"user_id": "123456789",
"email": "r****@***.com",
"name": "First Name",
"iat": 1759837407,
"exp": 1760442207
}
  • Confirmation of which Intercom secret was used (Web vs iOS Mobile)? iOS Mobile
  • App restart + logout logs to rule out a stale session? Yes

The issue got solved after updating to the latest version of the intercom/intercom-react-native package. I was on version 8.7.0 and updated to 9.1.2