Problem: `didReceiveRemoteNotification` is not called.
I do get notifications when my app is in background. (real device).I just want to have didReceiveRemoteNotification
called whenever notification arrives in background and no user interaction has been made (no tapping).
(My device is iOS 16.3 and Xcode is 14.1)
What I did
I have a Firebase server and I sent a push notification from Postman.
My header
I added apns-push-type, apns-priority, apns-topic (Apple Background push doc)
My Body
- I also tried true and "true" for
content-available
.
{
"aps" : {
"content-available" : 1
},
"to":"my fcm token",
"notification" : {
"title" : "Alarm",
"body" : "Testing"
}
}
Other settings
I did FirebaseApp.configure()
,
Messaging.messaging().delegate = self
,
UIApplication.shared.registerForRemoteNotifications()
, Messaging.messaging().apnsToken = deviceToken
.
I also added Push Notifications
and Background Modes
(Remote notifications, Background fetch)