Skip to content

Commit

Permalink
fix: remove completionHandler from finish (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
Naturalclar committed Nov 25, 2020
1 parent 53a3ecc commit 1506ddf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
node-version: [10,12,14]
node-version: [12,14]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
node-version: [10,12,14]
node-version: [12,14]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand All @@ -48,7 +48,7 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
node-version: [10,12,14]
node-version: [12,14]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand All @@ -69,7 +69,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
node-version: [10,12,14]
node-version: [12,14]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand Down
1 change: 1 addition & 0 deletions example/ios/example/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
withCompletionHandler:(void (^)(void))completionHandler {
[RNCPushNotificationIOS didReceiveNotificationResponse:response];
completionHandler();
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
Expand Down
9 changes: 2 additions & 7 deletions ios/RNCPushNotificationIOS.m
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,8 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification
[self sendEventWithName:@"remoteNotificationRegistrationError" body:errorDetails];
}

RCT_EXPORT_METHOD(onFinishRemoteNotification:(NSString *)notificationId fetchResult:(UIBackgroundFetchResult)result) {
RNCRemoteNotificationCallback completionHandler = self.remoteNotificationCallbacks[notificationId];
if (!completionHandler) {
RCTLogError(@"There is no completion handler with notification id: %@", notificationId);
return;
}
completionHandler(result);
RCT_EXPORT_METHOD(onFinishRemoteNotification:(NSString *)notificationId fetchResult:(UIBackgroundFetchResult)result)
{
[self.remoteNotificationCallbacks removeObjectForKey:notificationId];
}

Expand Down

0 comments on commit 1506ddf

Please sign in to comment.