Replies: 1 comment
-
Hmm 🤔 I'm unfamiliar with this use case. I think that's the use case for the Notifcation Extension helper in Notifee - it's native code, which is a pain, but the entire native apple native library (and it's symbols, apis etc) are available for use in the extension helper which should easy the pain? https://stackoverflow.com/questions/6340664/delete-a-particular-local-notification / similar for update ? The idea of the extension helper is that it is the only method the apple platform gives you to have control (for a short amount of time) and execute code in between an FCM notification message hitting the device and the notification posting. https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension?language=objc Right here in the docs https://notifee.app/react-native/docs/ios/remote-notification-support#2-in-a-notification-service-extension-in-your-app-when-a-device-receives-a-remote-message you might try to do what you want - mutate existing notifications - before posting the one that was sent high level API to cancel a notification as an example: https://notifee.app/react-native/reference/canceldisplayednotification None of this is fun, but...should be possible? |
Beta Was this translation helpful? Give feedback.
-
I understand data-only messages are unreliable on iOS.
For my app I need to be able to reliably and instantaneously send, update & cancel notifications remotely. Sending isn't an issue, I just attach a notification directly to the message and that works fine every time. But how to update and cancel notifications remotely? As far as I know there's no way to do this with just Firebase / APNS. I used to just use data-only messages and use Notifee to display, update and cancel notifications. This works fine on Android but is unreliable (and often simply does not work) on iOS.
I figured I could send a "Checking for updates..." notification object along with the message and disable sounds/vibration for that notification, and then cancelling that tmp notification in the background handler along with my updating and cancelling logic. But disabling sounds isn't possible with APNS either so that ain't an option either.
Surely there is a way to reliably update or cancel remote notifications? But how? Am I missing something?
Any input or ideas are welcome!
Beta Was this translation helpful? Give feedback.
All reactions