Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing there is no completion handler with notification id even if finish is called #216

Open
vishgoel007 opened this issue Oct 27, 2020 · 5 comments

Comments

@vishgoel007
Copy link

import PushNotificationIOS from "@react-native-community/push-notification-ios";

componentDidMount() {
    PushNotificationIOS.addEventListener("notification", this.onRemoteNotification);
}

  onRemoteNotification = (notification) => {

    let data = notification.getData();

    if (data) {
     // ...
    }
    notification.finish(PushNotificationIOS.FetchResult.NoData);
  };

I'm using remote notification listener like this and onRemoteNotification called when a remote notification come but when i trigger multiple notifications manually onRemoteNotification stopped calling for sometime and then start calling after like 10-15 minutes.
In xcode i'm getting this There is no completion handler with notification id: 4A0009xxxx-xxx but i have called finish function at the end of onRemoteNotification, so why i'm getting this no completion handler warning ?
and is it because of this no completion handler warning onRemoteNotification stopped calling for sometime ?

@joebernard
Copy link

I noticed that completionHandler() was removed from the instructions in the readme recently:
https://github.com/react-native-push-notification-ios/push-notification-ios/pull/207/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L119

Are you calling completionHandler() there? Perhaps this is related to your issue.

@vishgoel007
Copy link
Author

@joebernard Still showing same error even if I add completionHandler() in code.

@joebernard
Copy link

Could it be that APNS is throttling your notifications when you start sending multiple manually? Maybe Apple is delaying them and they are reaching your device late.

Do you see the completion handler error for all notifications or just when they are delayed?

@vishgoel007
Copy link
Author

@joebernard Notifications are not getting delayed, they are reaching on time but the listener handler onRemoteNotification stop getting called after sometime and then start behaving normally after approx 15 minutes.
And it is showing completion handler error for all notifications.

@jrobichaud
Copy link

I confirm fetchCompletionHandleris not called:

[RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:^(UIBackgroundFetchResult result){
    // Never called
  }];

along with this code:

PushNotificationIOS.addEventListener('notification', (notification) => {
  notification.finish(PushNotificationIOS.FetchResult.NoData);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants