wix / react-native-notifications

React Native Notifications
MIT License
3.25k stars 764 forks source link

iOS - Native method didReceiveRemoteNotification doesn't trigger if [RNNotifications startMonitorNotifications]; is in didFinishLaunchingWithOptions #885

Closed jpamarohorta closed 2 years ago

jpamarohorta commented 2 years ago

Hello, I have a use case where I need to combine multiple push notifications SDKs (e.g. Oracle & AppsFlyer) and still need to handle the push notification in React Native to show alerts (in foreground) and open a deep link (in background/terminated if the notification is pressed).

I've followed the iOS documentation and I noticed that if [RNNotifications startMonitorNotifications]; is present in the didFinishLaunchingWithOptions method I'm able to get the correct callbacks in React Native (for both foreground and background) but the native methods like didReceiveRemoteNotification never run, which stops me from using other push notifications related native SDKs.

If I remove [RNNotifications startMonitorNotifications]; from didFinishLaunchingWithOptions the native callbacks start working again.

Is this a bug or an expected behaviour? In the iOS documentation it indicated that the native method - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler should be implemented.

I'm using versions:

react-native: 0.65.1
react-native-notifications: 4.3.1

Thank you

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 2 years ago

The issue has been closed for inactivity.

sakramentas commented 1 year ago

@yedidyak Did you figure out what's the issue?