invertase / notifee

⚛️ A feature rich notifications library for React Native.
https://notifee.app
Apache License 2.0
1.88k stars 228 forks source link

iOS: Own userNotificationCenter:didRecieveNotificationResponse:withCompletionHandler is overwritten #925

Closed carlbleick closed 11 months ago

carlbleick commented 1 year ago

My team recently switched to Notifee to show in-app notifications. The app requires special notification handling in certain situations and utilizes custom native code for iOS and Android.

For iOS we use an own implementation for userNotificationCenter:didRecieveNotificationResponse:withCompletionHandler to send async requests after the user pressed a notification action.

Based on previous issues, I understand that Notifee intentionally overwrites this handler (https://github.com/invertase/notifee/issues/159, https://github.com/invertase/notifee/issues/644).

Currently I set notification categories for iOS and handle pressed actions in native code. While I was able to refactor most of the functionality by using the notifee.onBackgroundEvent(), the listener receives a pressed action significantly slower compared to the native implementation.

I am wondering: Is there currently any possibility to allow an own native implementation for the handler?

carlbleick commented 1 year ago

To fix this temporarily, I adjusted the NotifeeCore+UNUserNotificationCenter.m in NotifeeCore to call the original delegate.

For my specific case: Calling the original delegate (which is RNFBMessaging) will then itself call the original delegate (my own implementation).

[_originalDelegate userNotificationCenter:center
  didReceiveNotificationResponse:response
   withCompletionHandler:completionHandler];
github-actions[bot] commented 11 months ago

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

gotcha84 commented 9 months ago

I'm facing the same issue on iOS when trying to use Notifee and Iterable. The Notifee delegate seems to be overwriting the Iterable delegate.