Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions android/src/newarch/IntercomModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 3 additions & 0 deletions android/src/oldarch/IntercomModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 1 addition & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<UserAttributes, 'email' | 'userId'>
) => Promise<boolean>;
loginUserWithUserAttributes: (params: UserAttributes) => Promise<boolean>;

/**
* Log a user out of their Intercom session.
Expand Down
Loading