File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -107,15 +107,8 @@ - (NSData *)dataFromHexString:(NSString *)string {
107107RCT_EXPORT_METHOD (loginUserWithUserAttributes:(NSDictionary *)userAttributes
108108 success:(RCTPromiseResolveBlock)successCallback
109109 failure:(RCTResponseErrorBlock)failureCallback) {
110- NSString *userId = userAttributes[@" userId" ];
111- NSString *userEmail = userAttributes[@" email" ];
110+ ICMUserAttributes *attributes = [IntercomAttributesBuilder userAttributesForDictionary: userAttributes];
112111
113- if ([userId isKindOfClass: [NSNumber class ]]) {
114- userId = [(NSNumber *) userId stringValue ];
115- }
116- ICMUserAttributes *attributes = [ICMUserAttributes new ];
117- attributes.userId = userId;
118- attributes.email = userEmail;
119112 [Intercom loginUserWithUserAttributes: attributes success: ^{
120113 successCallback (@(YES ));
121114 } failure: ^(NSError * _Nonnull error) {
@@ -203,7 +196,7 @@ - (NSData *)dataFromHexString:(NSString *)string {
203196 selectedSpace = messages;
204197 } else if ([space isEqualToString: @" TICKETS" ]) {
205198 selectedSpace = tickets;
206- }
199+ }
207200 [Intercom presentIntercom: selectedSpace];
208201 RCTLog (@" Presenting Intercom Space : %@ " , space);
209202 resolve (@(YES ));
You can’t perform that action at this time.
0 commit comments