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?