ios icon indicating copy to clipboard operation
ios copied to clipboard

completionHandler not called by finish()?

Open anthonylinbp opened this issue 4 years ago • 3 comments

It's my understanding that we must call the completionHandler after handling remote notifications. As specified in the README under the section for finish(), it says:

"If you do not call this method your background remote notifications could be throttled, to read more about it see the above documentation link."

But after this change, #241, it looks like the completionHandler is never actually called by finish().

All finish() does is call this method (onFinishRemoteNotification):

RCT_EXPORT_METHOD(onFinishRemoteNotification:(NSString *)notificationId fetchResult:(UIBackgroundFetchResult)result) { [self.remoteNotificationCallbacks removeObjectForKey:notificationId]; }

which just removes it from the remoteNotificationCallbacks dictionary without calling it.

Is completionHandler actually being called somewhere?

anthonylinbp avatar Sep 01 '21 00:09 anthonylinbp

I don't even see finish being called in the example app. Very confused how this is implemented.

https://github.com/react-native-push-notification/ios/blob/master/example/App.js

joebernard avatar Nov 20 '21 13:11 joebernard

lol, I thought I was losing my mind, this is just broken

nicolas6422 avatar Jul 08 '22 17:07 nicolas6422

Seems like it's back https://github.com/react-native-push-notification/ios/commit/dd46810d08d32264a49507a665249cd492b13574

majirosstefan avatar Oct 25 '22 10:10 majirosstefan