diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bee3f8a4b..c467a1281 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/example/ios/example/AppDelegate.m b/example/ios/example/AppDelegate.m index 194592ddd..eb79603c6 100644 --- a/example/ios/example/AppDelegate.m +++ b/example/ios/example/AppDelegate.m @@ -104,6 +104,7 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { [RNCPushNotificationIOS didReceiveNotificationResponse:response]; + completionHandler(); } - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { diff --git a/ios/RNCPushNotificationIOS.m b/ios/RNCPushNotificationIOS.m index 3544187bd..fe4376832 100644 --- a/ios/RNCPushNotificationIOS.m +++ b/ios/RNCPushNotificationIOS.m @@ -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]; }