I have an app implemented with fcm . I can receive push notifications in all cases, that works good. But didReceiveRemoteNotification
is not call if app is terminated / kill by user. if app is in background or for-ground it is calling. App is terminated notification is coming, but didReceiveRemoteNotification:fetchCompletionHandler
didn't call.
My Question is what is the trigger method app is terminated and a firebase notification received.I used Swift 4.2 and Xcode 10.0. I enable background Modes - Remote notifications from capabilities.
With Firebase I send this JSON:
{
"to": "/topics/group1",
"priority" : "high",
"content-available": true,
"notification" : {
"body" : "Yes you recevied !",
"sound": "default",
"title" : "Notification"
},
"data": {
"type" : "IOS"
}
}
From the Apple docs:
You actually can get it round by enabling VoIP background mode, but it will reduce your chances to pass review in the app store.