I am facing this problem with APNS. I am trying to store the received messages to the mobile database to show them as a list in my app.
DidReceiveRemoteNotification doesn't get called when the app is closed (not in the background). The notification itself shows up.
Background and foreground work perfectly.
Enabled Background Modes and Remote notifications in plist.
Payload:
{
"aps":{
"alert":{
"title":"Title",
"body":"App is closed... "
},
"badge":1,
"sound":"default",
"content-available":1
}
}
I can confirm that "FinishedLaunching" gets called when the user taps the notification.
The problem is that the user can start the application directly via the App Icon. In that case, my app would miss all the notifications which were performed when the app was closed.
Thanks in advance.