Skip to content

Commit acf8d3b

Browse files
committed
Fixed typo in didReceiveNotificationExtensionRequest method name
* Also receivedRequest in SDK dev test app.
1 parent 150f790 commit acf8d3b

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

iOS_SDK/OneSignalDevApp/OneSignalNotificationServiceExtension/NotificationService.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
@interface NotificationService ()
66

77
@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
8-
@property (nonatomic, strong) UNNotificationRequest *recievedRequest;
8+
@property (nonatomic, strong) UNNotificationRequest *receivedRequest;
99
@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;
1010

1111
@end
1212

1313
@implementation NotificationService
1414

1515
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
16-
self.recievedRequest = request;
16+
self.receivedRequest = request;
1717
self.contentHandler = contentHandler;
1818
self.bestAttemptContent = [request.content mutableCopy];
1919

2020
self.bestAttemptContent.body = @"test [modified]";
2121

22-
[OneSignal didReceiveNotificatioExtensionnRequest:self.recievedRequest withMutableNotificationContent:self.bestAttemptContent];
22+
[OneSignal didReceiveNotificationExtensionRequest:self.receivedRequest withMutableNotificationContent:self.bestAttemptContent];
2323

2424
self.contentHandler(self.bestAttemptContent);
2525
}
@@ -28,7 +28,7 @@ - (void)serviceExtensionTimeWillExpire {
2828
// Called just before the extension will be terminated by the system.
2929
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
3030

31-
[OneSignal serviceExtensionTimeWillExpireRequest:self.recievedRequest withMutableNotificationContent:self.bestAttemptContent];
31+
[OneSignal serviceExtensionTimeWillExpireRequest:self.receivedRequest withMutableNotificationContent:self.bestAttemptContent];
3232

3333
self.contentHandler(self.bestAttemptContent);
3434
}

iOS_SDK/OneSignalSDK/Source/OneSignal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) {
280280
// iOS 10 only
281281
// Process from Notification Service Extension.
282282
// Used for iOS Media Attachemtns and Action Buttons.
283-
+ (UNMutableNotificationContent*)didReceiveNotificatioExtensionnRequest:(UNNotificationRequest *)request withMutableNotificationContent:(UNMutableNotificationContent*)replacementContent;
283+
+ (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest *)request withMutableNotificationContent:(UNMutableNotificationContent*)replacementContent;
284284
+ (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest *)request withMutableNotificationContent:(UNMutableNotificationContent*)replacementContent;
285285
#endif
286286

iOS_SDK/OneSignalSDK/Source/OneSignal.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ + (void)addActionButtonsToExtentionRequest:(UNNotificationRequest *)request with
14031403
}
14041404

14051405
// Called from the app's Notification Service Extension
1406-
+ (UNMutableNotificationContent*)didReceiveNotificatioExtensionnRequest:(UNNotificationRequest *)request withMutableNotificationContent:(UNMutableNotificationContent*)replacementContent {
1406+
+ (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest *)request withMutableNotificationContent:(UNMutableNotificationContent*)replacementContent {
14071407
if (!replacementContent)
14081408
replacementContent = [request.content mutableCopy];
14091409

iOS_SDK/OneSignalSDK/UnitTests/UnitTests.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ - (void) testDidReceiveNotificatioExtensionRequest {
10531053

10541054
id notifResponse = [self createBasiciOSNotificationResponseWithPayload:userInfo];
10551055

1056-
UNMutableNotificationContent* content = [OneSignal didReceiveNotificatioExtensionnRequest:[notifResponse notification].request withMutableNotificationContent:nil];
1056+
UNMutableNotificationContent* content = [OneSignal didReceiveNotificationExtensionRequest:[notifResponse notification].request withMutableNotificationContent:nil];
10571057

10581058
// Make sure butons were added.
10591059
XCTAssertEqualObjects(content.categoryIdentifier, @"__dynamic__");
@@ -1074,13 +1074,13 @@ - (void) testDidReceiveNotificatioExtensionRequest {
10741074
}};
10751075

10761076
notifResponse = [self createBasiciOSNotificationResponseWithPayload:userInfo];
1077-
[OneSignal didReceiveNotificatioExtensionnRequest:[notifResponse notification].request withMutableNotificationContent:nil];
1077+
[OneSignal didReceiveNotificationExtensionRequest:[notifResponse notification].request withMutableNotificationContent:nil];
10781078

10791079
XCTAssertEqual([lastSetCategories count], 3);
10801080
}
10811081

10821082
// iOS 10 - Notification Service Extension test
1083-
- (void) testDidReceiveNotificatioExtensionnRequestDontOverrideCateogory {
1083+
- (void) testDidReceiveNotificationExtensionRequestDontOverrideCateogory {
10841084
id userInfo = @{@"aps": @{
10851085
@"mutable-content": @1,
10861086
@"alert": @"Message Body"
@@ -1095,7 +1095,7 @@ - (void) testDidReceiveNotificatioExtensionnRequestDontOverrideCateogory {
10951095

10961096
[[notifResponse notification].request.content setValue:@"some_category" forKey:@"categoryIdentifier"];
10971097

1098-
UNMutableNotificationContent* content = [OneSignal didReceiveNotificatioExtensionnRequest:[notifResponse notification].request withMutableNotificationContent:nil];
1098+
UNMutableNotificationContent* content = [OneSignal didReceiveNotificationExtensionRequest:[notifResponse notification].request withMutableNotificationContent:nil];
10991099

11001100
// Make sure we didn't override an existing category
11011101
XCTAssertEqualObjects(content.categoryIdentifier, @"some_category");

0 commit comments

Comments
 (0)