react-native-push-notification / ios

React Native Push Notification API for iOS.
MIT License
753 stars 288 forks source link

fix: support userInteraction for didReceiveRemoteNotification #434

Closed bang9 closed 3 weeks ago

bang9 commented 8 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 8 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