Issue:
I am making an application that stores data locally from notifications fired from the server. Everything works fine in the foreground but the background is having problems with not being triggered when notifications are fired.
So we tried firing 2 notifications at the same time, including default and silent types. But the problem continues to arise on ios 18, when firing multiple times like that, the trigger is not handling all notifications, leading to data loss. I tried on ios 15 and it worked fine.
Environment:
- Device or Simulator: Iphone 11 pro max (iOS 18.3.2
Steps to Reproduce:
- Open app, allow received notification.
- Move app to background mode or terminate app.
- Sent 2 notifications:
a. Default notification payload:
{
"aps": {
"content-available": 1
},
”notification”: {…},
“alert”: {..},
“data": "some_value"
}
b. Silent notification payload:
{
"aps": {
"content-available": 1
},
”data": "some_value"
}
What I've Tried:
- Trigger notification in function:
application(_:didReceiveRemoteNotification:fetchCompletionHandler:)
- Handle write data to local storage in above function, put it in background thread also.
Thanks in advance!