-
I am trying to get setBackgroundMessageHandler to fire on an iOS device. My end goal is to decrypt the message payload and display a custom notification with the decrypted data. Is this possible with I have done the following
My situation seems very similar to this comment Based on the following table and this documentation snippet
Based on the above, If I send an FCM message with a notification+data it should trigger the setBackgroundMessageHandler and I should be able to decrypt the message and display a custom notification? (ie something like this However, I am confused by these comments #4705 (comment) #4705 (comment) from @mikehardy
Also this comment #3530 (comment) suggests that the payload must be data-only, with contentAvailable: true and So is the current documentation just wrong? Data-only payloads in apple's terminology are background notifications, is the Either way I've never managed to get the background message handler to fire. So to re-iterate my question, will it be possible to intercept the message when in background or quit, decrypt the message and display a custom notification using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think you are going to want Notification Extension yes, you might like https://notifee.app and the docs there Without a notification extension: With a notification extension: |
Beta Was this translation helpful? Give feedback.
I think you are going to want Notification Extension yes, you might like https://notifee.app and the docs there
Without a notification extension:
if you do mixed payload, what you get is an SDK-provided notification and then when user clicks data is available
If you do data-only payload, your delivery will not be guaranteed and it will lead to disappointment I think
If you do notification-only, you get a SDK-provided notification
With a notification extension:
you don't have to do data-only, so delivery is better
so you may include a notification payload now, but you get to run code to modify the notification before it's presented