react-native-push-notification / ios

React Native Push Notification API for iOS.
MIT License
731 stars 280 forks source link

fix: support userInteraction for didReceiveRemoteNotification #434

Open bang9 opened 3 months ago

bang9 commented 3 months ago

No matter which type of push notification (local or remote) is clicked, I expected the recommended API, didReceiveNotificationResponse, to work. However, it's not functioning as expected some environment.(maybe firebase integration problem?)

When didReceiveNotificationResponse doesn't work, didReceiveRemoteNotification works even when the notification is clicked. 🤔 Following the guide, I tried to implement it, but userInteraction isn't always present.

Although it's a very hacky, the point of clicking in the background and opening the status bar to click on the push banner is considered an inactive state. So, it works using this approach.

If there's a better way, please let me know. A video is attached for reference.

https://github.com/react-native-push-notification/ios/assets/26326015/714d33d1-e886-4fe4-9206-92dbfcefeba2

bang9 commented 3 months ago

For those searching for the answer: The issue with didReceiveNotificationResponse not working was a bug in Notifee https://github.com/invertase/notifee/issues/925