Skip to content
Merged
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 iOS_SDK/OneSignalSDK/Source/OneSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,13 +585,16 @@ typedef void (^OSEmailSuccessBlock)();

// External user id
// Typedefs defining completion blocks for updating the external user id
typedef void (^OSUpdateExternalUserIdBlock)(NSDictionary* results);
typedef void (^OSUpdateExternalUserIdFailureBlock)(NSError *error);
typedef void (^OSUpdateExternalUserIdSuccessBlock)(NSDictionary *results);

+ (void)setExternalUserId:(NSString * _Nonnull)externalId;
+ (void)setExternalUserId:(NSString * _Nonnull)externalId withCompletion:(OSUpdateExternalUserIdBlock _Nullable)completionBlock;
+ (void)setExternalUserId:(NSString * _Nonnull)externalId withSuccess:(OSUpdateExternalUserIdSuccessBlock _Nullable)successBlock withFailure:(OSUpdateExternalUserIdFailureBlock _Nullable)failureBlock;
+ (void)setExternalUserId:(NSString *)externalId withExternalIdAuthHashToken:(NSString *)hashToken withSuccess:(OSUpdateExternalUserIdSuccessBlock _Nullable)successBlock withFailure:(OSUpdateExternalUserIdFailureBlock _Nullable)failureBlock;
+ (void)removeExternalUserId;
+ (void)removeExternalUserId:(OSUpdateExternalUserIdBlock _Nullable)completionBlock;
+ (void)removeExternalUserId:(OSUpdateExternalUserIdSuccessBlock _Nullable)successBlock withFailure:(OSUpdateExternalUserIdFailureBlock _Nullable)failureBlock;

// In-App Messaging triggers
Expand Down
8 changes: 8 additions & 0 deletions iOS_SDK/OneSignalSDK/Source/OneSignal.m
Original file line number Diff line number Diff line change
Expand Up @@ -2622,6 +2622,10 @@ + (void)setExternalUserId:(NSString * _Nonnull)externalId {
[self setExternalUserId:externalId withSuccess:nil withFailure:nil];
}

+ (void)setExternalUserId:(NSString *)externalId withCompletion:(OSUpdateExternalUserIdBlock)completionBlock {
[self setExternalUserId:externalId withSuccess:completionBlock withFailure:nil];
}

+ (void)setExternalUserId:(NSString * _Nonnull)externalId withSuccess:(OSUpdateExternalUserIdSuccessBlock _Nullable)successBlock withFailure:(OSUpdateExternalUserIdFailureBlock _Nullable)failureBlock {
// return if the user has not granted privacy permissions
if ([self shouldLogMissingPrivacyConsentErrorWithMethodName:@"setExternalUserId:withSuccess:withFailure:"])
Expand Down Expand Up @@ -2692,6 +2696,10 @@ + (void)removeExternalUserId {
[self setExternalUserId:@""];
}

+ (void)removeExternalUserId:(OSUpdateExternalUserIdBlock)completionBlock {
[self removeExternalUserId:completionBlock withFailure:nil];
}

+ (void)removeExternalUserId:(OSUpdateExternalUserIdSuccessBlock _Nullable)successBlock withFailure:(OSUpdateExternalUserIdFailureBlock _Nullable)failureBlock {
// return if the user has not granted privacy permissions
if ([self shouldLogMissingPrivacyConsentErrorWithMethodName:@"removeExternalUserId:"])
Expand Down