Skip to content

Commit fae3af0

Browse files
authored
Fix cancelLocalNotification on iOS (#617)
1 parent 495d738 commit fae3af0

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

lib/ios/RNBridgeModule.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ - (void)setBridge:(RCTBridge *)bridge {
7272
[_commandsHandler postLocalNotification:notification withId:notificationId];
7373
}
7474

75-
RCT_EXPORT_METHOD(cancelLocalNotification:(NSString *)notificationId) {
75+
RCT_EXPORT_METHOD(cancelLocalNotification:(nonnull NSNumber *)notificationId) {
7676
[_commandsHandler cancelLocalNotification:notificationId];
7777
}
7878

lib/ios/RNCommandsHandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
- (void)postLocalNotification:(NSDictionary *)notification withId:(NSNumber *)notificationId;
2727

28-
- (void)cancelLocalNotification:(NSString *)notificationId;
28+
- (void)cancelLocalNotification:(NSNumber *)notificationId;
2929

3030
- (void)cancelAllLocalNotifications;
3131

lib/ios/RNCommandsHandler.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ - (void)postLocalNotification:(NSDictionary *)notification withId:(NSNumber *)no
5454
[_notificationCenter postLocalNotification:notification withId:notificationId];
5555
}
5656

57-
- (void)cancelLocalNotification:(NSString *)notificationId {
57+
- (void)cancelLocalNotification:(NSNumber *)notificationId {
5858
[_notificationCenter cancelLocalNotification:notificationId];
5959
}
6060

lib/ios/RNNotificationCenter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ typedef void (^RCTPromiseRejectBlock)(NSString *code, NSString *message, NSError
1818

1919
- (void)postLocalNotification:(NSDictionary *)notification withId:(NSNumber *)notificationId;
2020

21-
- (void)cancelLocalNotification:(NSString *)notificationId;
21+
- (void)cancelLocalNotification:(NSNumber *)notificationId;
2222

2323
- (void)removeAllDeliveredNotifications;
2424

lib/ios/RNNotificationCenter.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ - (void)postLocalNotification:(NSDictionary *)notification withId:(NSNumber *)no
3535
[[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:localNotification withCompletionHandler:nil];
3636
}
3737

38-
- (void)cancelLocalNotification:(NSString *)notificationId {
38+
- (void)cancelLocalNotification:(NSNumber *)notificationId {
3939
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
40-
[center removePendingNotificationRequestsWithIdentifiers:@[notificationId]];
40+
[center removePendingNotificationRequestsWithIdentifiers:@[[notificationId stringValue]]];
4141
}
4242

4343
- (void)removeAllDeliveredNotifications {

0 commit comments

Comments
 (0)