Skip to content

Commit 010a65a

Browse files
committed
Revert "Reverted back logic of caching identity if session is uninitialized."
This reverts commit 03cf05b.
1 parent 03cf05b commit 010a65a

File tree

2 files changed

+4
-31
lines changed

2 files changed

+4
-31
lines changed

BranchSDK/Branch.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1857,7 +1857,6 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) {
18571857
#endif
18581858

18591859
@property (copy, nonatomic, nullable) NSString *installUserId;
1860-
@property (copy, nonatomic, nullable) callbackWithParams setIdentityCallback;
18611860

18621861
@end
18631862

BranchSDK/Branch.m

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,36 +1049,11 @@ - (void)setIdentity:(NSString *)userId {
10491049
}
10501050

10511051
- (void)setIdentity:(NSString *)userId withCallback:(callbackWithParams)callback {
1052-
if (!userId || [self.preferenceHelper.userIdentity isEqualToString:userId]) {
1053-
if (callback) {
1054-
callback([self getFirstReferringParams], nil);
1055-
}
1056-
return;
1057-
}
1058-
1059-
if (self.initializationStatus == BNCInitStatusUninitialized ) {
1060-
[self cacheIdentity:userId withCallback:callback];
1061-
} else {
1052+
if (userId) {
10621053
self.preferenceHelper.userIdentity = userId;
1063-
if (callback) {
1064-
callback([self getFirstReferringParams], nil);
1065-
}
10661054
}
1067-
}
1068-
1069-
- (void) cacheIdentity: (NSString *)userId withCallback:(callbackWithParams)callback {
1070-
self.installUserId = userId;
1071-
self.setIdentityCallback = callback;
1072-
}
1073-
1074-
- (void) applySavedIdentity {
1075-
if (self.installUserId != nil) {
1076-
self.preferenceHelper.userIdentity = self.installUserId;
1077-
if (self.setIdentityCallback) {
1078-
self.setIdentityCallback([self getFirstReferringParams], nil);
1079-
}
1080-
self.installUserId = nil;
1081-
self.setIdentityCallback = nil;
1055+
if (callback) {
1056+
callback([self getFirstReferringParams], nil);
10821057
}
10831058
}
10841059

@@ -2287,8 +2262,7 @@ - (void)handleInitSuccessAndCallCallback:(BOOL)callCallback sceneIdentifier:(NSS
22872262
}
22882263
}
22892264
[self sendOpenNotificationWithLinkParameters:latestReferringParams error:nil];
2290-
2291-
[self applySavedIdentity];
2265+
22922266

22932267
if (!self.urlFilter.hasUpdatedPatternList) {
22942268
[self.urlFilter updatePatternListWithCompletion:nil];

0 commit comments

Comments
 (0)