I'm using FCM and differents version of iOS (the oldest is 15.2) on a SwiftUI app. I'm working with silent notifications and everything works well with notifications. I can manage notification behaviour in foreground, in background and when app is killed.
If i launch an fcm like this
"to": "/topics/all",
"priority": "high",
"content_available": true,
"data": {
"custom_id": 1
}
didReceiveRemoteNotification
is called and all works well.
If i use notification attribute like this
"to": "/topics/all",
"priority": "high",
"content_available": true,
"notification": {
"body": "Sample body",
"title": "Sample title"
}
"data": {
"custom_id": 1
}
i see the clickable banner and didReceiveRemoteNotification
is also called.
I can unistall and reinstll the application, everything still to works.
Problem comes when i reboot/restart the device.
After reboot, didReceiveRemoteNotification
seems not to be called.
if i use
"notification": {
"body": "Sample body",
"title": "Sample title"
}
i see the clickable banner but didReceiveRemoteNotification
is not called even after banner click.
After reboot, I tried to send fcm keeping close the app, opening for first time by icon and opening for first time by notification banner but nothing change.
didReceiveRemoteNotification
remains not called.
The only way to see didReceiveRemoteNotification
already called is unistall and reinstall application. Sometimes it's starts to work again after many hours.
It's looks like a strage behaviour. I saw a lot of documentation and topics about similar problems and i tried a lot of things, but nothing seems to solve this problem.