I am having trouble getting my app to receive silent push notifications while it is in the foreground. I have correctly set up push notifications and can receive "alert" notifications (ones that have an alert, sound, or badge) no problem no matter what state the app is in. But when I send the following push notification payload:
{
"aps": {
"content-available": 1
}
}
My app will not receive it via the app delegate application:didReceiveRemoteNotification:completionHandler:
. I have "Remote notification" checked and enabled in Signing & Capabilities.
The crazy thing is, I know I am sending it correctly and the phone is receiving it correctly because if I change my run scheme to "Wait for executable to be launched" and run the app, sending that very same notification will launch the app automatically (and the push notification payload will be included in launchOptions
). I just can't see any reason why my delegate method wouldn't be called if the app is already in the foreground (or even the background).
Has anyone experienced this before and possibly know where to look to see if I've altered a setting incorrectly somewhere? This is on an iPhone running 13.3 and using Xcode 11.3.