Skip to content

Commit 1e886f0

Browse files
authored
Add old callback for external user id auth (#809)
1 parent abebdd8 commit 1e886f0

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

iOS_SDK/OneSignalSDK/Source/OneSignal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,13 +585,16 @@ typedef void (^OSEmailSuccessBlock)();
585585

586586
// External user id
587587
// Typedefs defining completion blocks for updating the external user id
588+
typedef void (^OSUpdateExternalUserIdBlock)(NSDictionary* results);
588589
typedef void (^OSUpdateExternalUserIdFailureBlock)(NSError *error);
589590
typedef void (^OSUpdateExternalUserIdSuccessBlock)(NSDictionary *results);
590591

591592
+ (void)setExternalUserId:(NSString * _Nonnull)externalId;
593+
+ (void)setExternalUserId:(NSString * _Nonnull)externalId withCompletion:(OSUpdateExternalUserIdBlock _Nullable)completionBlock;
592594
+ (void)setExternalUserId:(NSString * _Nonnull)externalId withSuccess:(OSUpdateExternalUserIdSuccessBlock _Nullable)successBlock withFailure:(OSUpdateExternalUserIdFailureBlock _Nullable)failureBlock;
593595
+ (void)setExternalUserId:(NSString *)externalId withExternalIdAuthHashToken:(NSString *)hashToken withSuccess:(OSUpdateExternalUserIdSuccessBlock _Nullable)successBlock withFailure:(OSUpdateExternalUserIdFailureBlock _Nullable)failureBlock;
594596
+ (void)removeExternalUserId;
597+
+ (void)removeExternalUserId:(OSUpdateExternalUserIdBlock _Nullable)completionBlock;
595598
+ (void)removeExternalUserId:(OSUpdateExternalUserIdSuccessBlock _Nullable)successBlock withFailure:(OSUpdateExternalUserIdFailureBlock _Nullable)failureBlock;
596599

597600
// In-App Messaging triggers

iOS_SDK/OneSignalSDK/Source/OneSignal.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,6 +2622,10 @@ + (void)setExternalUserId:(NSString * _Nonnull)externalId {
26222622
[self setExternalUserId:externalId withSuccess:nil withFailure:nil];
26232623
}
26242624

2625+
+ (void)setExternalUserId:(NSString *)externalId withCompletion:(OSUpdateExternalUserIdBlock)completionBlock {
2626+
[self setExternalUserId:externalId withSuccess:completionBlock withFailure:nil];
2627+
}
2628+
26252629
+ (void)setExternalUserId:(NSString * _Nonnull)externalId withSuccess:(OSUpdateExternalUserIdSuccessBlock _Nullable)successBlock withFailure:(OSUpdateExternalUserIdFailureBlock _Nullable)failureBlock {
26262630
// return if the user has not granted privacy permissions
26272631
if ([self shouldLogMissingPrivacyConsentErrorWithMethodName:@"setExternalUserId:withSuccess:withFailure:"])
@@ -2692,6 +2696,10 @@ + (void)removeExternalUserId {
26922696
[self setExternalUserId:@""];
26932697
}
26942698

2699+
+ (void)removeExternalUserId:(OSUpdateExternalUserIdBlock)completionBlock {
2700+
[self removeExternalUserId:completionBlock withFailure:nil];
2701+
}
2702+
26952703
+ (void)removeExternalUserId:(OSUpdateExternalUserIdSuccessBlock _Nullable)successBlock withFailure:(OSUpdateExternalUserIdFailureBlock _Nullable)failureBlock {
26962704
// return if the user has not granted privacy permissions
26972705
if ([self shouldLogMissingPrivacyConsentErrorWithMethodName:@"removeExternalUserId:"])

0 commit comments

Comments
 (0)