Skip to content

Commit a65b469

Browse files
committed
Corrected promptForPushNotificationsWithUserResponse method name.
* Added deprecated warning to idsAvailableBlock and registerForPushNotifications
1 parent b62a71d commit a65b469

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/Headers/OneSignal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) {
293293

294294
// Only use if you set kOSSettingsKeyAutoPrompt to false
295295
+ (void)registerForPushNotifications;
296-
+ (void)promptForPushNotificationWithUserResponse:(void(^)(BOOL accepted))completionHandler;
296+
+ (void)promptForPushNotificationsWithUserResponse:(void(^)(BOOL accepted))completionHandler;
297297

298298
// - Logging
299299
+ (void)setLogLevel:(ONE_S_LOG_LEVEL)logLevel visualLevel:(ONE_S_LOG_LEVEL)visualLogLevel;

iOS_SDK/OneSignalSDK/Source/OneSignal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) {
292292
+ (NSString*)sdk_semantic_version;
293293

294294
// Only use if you set kOSSettingsKeyAutoPrompt to false
295-
+ (void)registerForPushNotifications;
296-
+ (void)promptForPushNotificationWithUserResponse:(void(^)(BOOL accepted))completionHandler;
295+
+ (void)registerForPushNotifications __deprecated_msg("Please use promptForPushNotificationsWithUserResponse instead.");
296+
+ (void)promptForPushNotificationsWithUserResponse:(void(^)(BOOL accepted))completionHandler;
297297

298298
// - Logging
299299
+ (void)setLogLevel:(ONE_S_LOG_LEVEL)logLevel visualLevel:(ONE_S_LOG_LEVEL)visualLogLevel;
@@ -318,7 +318,7 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) {
318318
+ (void)syncHashedEmail:(NSString*)email;
319319

320320
// - Subscription and Permissions
321-
+ (void)IdsAvailable:(OSIdsAvailableBlock)idsAvailableBlock;
321+
+ (void)IdsAvailable:(OSIdsAvailableBlock)idsAvailableBlock __deprecated_msg("Please use getPermissionSubscriptionState or addSubscriptionObserver and addPermissionObserver instead.");
322322

323323
+ (OSPermissionSubscriptionState*)getPermissionSubscriptionState;
324324

iOS_SDK/OneSignalSDK/Source/OneSignal.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ + (BOOL)registerForAPNsToken {
507507
return true;
508508
}
509509

510-
+ (void)promptForPushNotificationWithUserResponse:(void(^)(BOOL accepted))completionHandler {
510+
+ (void)promptForPushNotificationsWithUserResponse:(void(^)(BOOL accepted))completionHandler {
511511
[OneSignal onesignal_Log:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"registerForPushNotifications Called:waitingForApnsResponse: %d", waitingForApnsResponse]];
512512

513513
self.currentPermissionState.hasPrompted = true;
@@ -518,7 +518,7 @@ + (void)promptForPushNotificationWithUserResponse:(void(^)(BOOL accepted))comple
518518
// This registers for a push token and prompts the user for notifiations permisions
519519
// Will trigger didRegisterForRemoteNotificationsWithDeviceToken on the AppDelegate when APNs responses.
520520
+ (void)registerForPushNotifications {
521-
[self promptForPushNotificationWithUserResponse:nil];
521+
[self promptForPushNotificationsWithUserResponse:nil];
522522
}
523523

524524

iOS_SDK/OneSignalSDK/UnitTests/UnitTests.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,13 +1410,13 @@ - (void)testInitAcceptingNotificationsWithoutCapabilitesSet {
14101410
}
14111411

14121412

1413-
- (void)testPromptForPushNotificationWithUserResponse {
1413+
- (void)testPromptForPushNotificationsWithUserResponse {
14141414
[self setCurrentNotificationPermissionAsUnanswered];
14151415

14161416
[self initOneSignal];
14171417

14181418
__block BOOL didAccept;
1419-
[OneSignal promptForPushNotificationWithUserResponse:^(BOOL accepted) {
1419+
[OneSignal promptForPushNotificationsWithUserResponse:^(BOOL accepted) {
14201420
didAccept = accepted;
14211421
}];
14221422
[self backgroundApp];
@@ -1425,14 +1425,14 @@ - (void)testPromptForPushNotificationWithUserResponse {
14251425
XCTAssertTrue(didAccept);
14261426
}
14271427

1428-
- (void)testPromptForPushNotificationWithUserResponseOnIOS8 {
1428+
- (void)testPromptForPushNotificationsWithUserResponseOnIOS8 {
14291429
[self setCurrentNotificationPermissionAsUnanswered];
14301430
mockIOSVersion = 8;
14311431

14321432
[self initOneSignal];
14331433

14341434
__block BOOL didAccept;
1435-
[OneSignal promptForPushNotificationWithUserResponse:^(BOOL accepted) {
1435+
[OneSignal promptForPushNotificationsWithUserResponse:^(BOOL accepted) {
14361436
didAccept = accepted;
14371437
}];
14381438
[self backgroundApp];
@@ -1441,14 +1441,14 @@ - (void)testPromptForPushNotificationWithUserResponseOnIOS8 {
14411441
XCTAssertTrue(didAccept);
14421442
}
14431443

1444-
- (void)testPromptForPushNotificationWithUserResponseOnIOS7 {
1444+
- (void)testPromptForPushNotificationsWithUserResponseOnIOS7 {
14451445
[self setCurrentNotificationPermissionAsUnanswered];
14461446
mockIOSVersion = 7;
14471447

14481448
[self initOneSignal];
14491449

14501450
__block BOOL didAccept;
1451-
[OneSignal promptForPushNotificationWithUserResponse:^(BOOL accepted) {
1451+
[OneSignal promptForPushNotificationsWithUserResponse:^(BOOL accepted) {
14521452
didAccept = accepted;
14531453
}];
14541454
[self backgroundApp];

0 commit comments

Comments
 (0)