Skip to content

Commit 1506ddf

Browse files
authored
fix: remove completionHandler from finish (#241)
1 parent 53a3ecc commit 1506ddf

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-18.04
77
strategy:
88
matrix:
9-
node-version: [10,12,14]
9+
node-version: [12,14]
1010
steps:
1111
- uses: actions/checkout@v2
1212
- uses: actions/setup-node@v1
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-18.04
2828
strategy:
2929
matrix:
30-
node-version: [10,12,14]
30+
node-version: [12,14]
3131
steps:
3232
- uses: actions/checkout@v2
3333
- uses: actions/setup-node@v1
@@ -48,7 +48,7 @@ jobs:
4848
runs-on: ubuntu-18.04
4949
strategy:
5050
matrix:
51-
node-version: [10,12,14]
51+
node-version: [12,14]
5252
steps:
5353
- uses: actions/checkout@v2
5454
- uses: actions/setup-node@v1
@@ -69,7 +69,7 @@ jobs:
6969
runs-on: macos-latest
7070
strategy:
7171
matrix:
72-
node-version: [10,12,14]
72+
node-version: [12,14]
7373
steps:
7474
- uses: actions/checkout@v2
7575
- uses: actions/setup-node@v1

example/ios/example/AppDelegate.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center
104104
didReceiveNotificationResponse:(UNNotificationResponse *)response
105105
withCompletionHandler:(void (^)(void))completionHandler {
106106
[RNCPushNotificationIOS didReceiveNotificationResponse:response];
107+
completionHandler();
107108
}
108109

109110
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {

ios/RNCPushNotificationIOS.m

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,8 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification
168168
[self sendEventWithName:@"remoteNotificationRegistrationError" body:errorDetails];
169169
}
170170

171-
RCT_EXPORT_METHOD(onFinishRemoteNotification:(NSString *)notificationId fetchResult:(UIBackgroundFetchResult)result) {
172-
RNCRemoteNotificationCallback completionHandler = self.remoteNotificationCallbacks[notificationId];
173-
if (!completionHandler) {
174-
RCTLogError(@"There is no completion handler with notification id: %@", notificationId);
175-
return;
176-
}
177-
completionHandler(result);
171+
RCT_EXPORT_METHOD(onFinishRemoteNotification:(NSString *)notificationId fetchResult:(UIBackgroundFetchResult)result)
172+
{
178173
[self.remoteNotificationCallbacks removeObjectForKey:notificationId];
179174
}
180175

0 commit comments

Comments
 (0)