diff --git a/android/src/newarch/IntercomModule.java b/android/src/newarch/IntercomModule.java index c892bd10..a6e4d8f3 100644 --- a/android/src/newarch/IntercomModule.java +++ b/android/src/newarch/IntercomModule.java @@ -192,6 +192,9 @@ public void loginUserWithUserAttributes(ReadableMap params, Promise promise) { promise.reject(IntercomErrorCodes.IDENTIFIED_REGISTRATION, "Invalid userId or email"); } if (registration != null) { + UserAttributes userAttributes = IntercomHelpers.buildUserAttributes(params); + registration.withUserAttributes(userAttributes); + Intercom.client().loginIdentifiedUser(registration, new IntercomStatusCallback() { @Override public void onSuccess() { diff --git a/android/src/oldarch/IntercomModule.java b/android/src/oldarch/IntercomModule.java index 32afd733..06529479 100644 --- a/android/src/oldarch/IntercomModule.java +++ b/android/src/oldarch/IntercomModule.java @@ -169,6 +169,9 @@ public void loginUserWithUserAttributes(ReadableMap params, Promise promise) { promise.reject(IntercomErrorCodes.IDENTIFIED_REGISTRATION, "Invalid userId or email"); } if (registration != null) { + UserAttributes userAttributes = IntercomHelpers.buildUserAttributes(params); + registration.withUserAttributes(userAttributes); + Intercom.client().loginIdentifiedUser(registration, new IntercomStatusCallback() { @Override public void onSuccess() { diff --git a/src/index.tsx b/src/index.tsx index 856152b1..074509bd 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -101,9 +101,7 @@ export type IntercomType = { * Valid identifiers are `userId` and `email` which must be set in the {@link UserAttributes} object. * @param params The {@link UserAttributes} object that contains the user's `email` or `userId`. */ - loginUserWithUserAttributes: ( - params: Pick - ) => Promise; + loginUserWithUserAttributes: (params: UserAttributes) => Promise; /** * Log a user out of their Intercom session.