Silent push notifications not working when app is in background

I want to send my app silent push notifications while it is running in the background, but I've been unable to get it to work.

I understand how to send the notification by setting the content-available flag, and I've implemented the "didReceiveRemoteNotification" function in my app delegate. It works, but only if the app is open and running in the foreground. As soon as I put it in the background, didReceiveRemoteNotification doesn't get called again unless I reopen the app.

I feel certain that I should be able to receive these notifications when my app is in the background. I have both "Remote notifications" and "Background processing" checked in Signing & Capabilities.

Thanks, Frank

  • I also made sure to use the "conserve power" priority and the "background" notification type when posting the notification.

Add a Comment

Replies

Hi,

try adding the "background fetch" in the signing & capabilities. We are using it with the silent push notification also. That might solve the issue. Also note that, I think silent push notification is not guaranteed to be delivered and that's what we having trouble with. it is according to this link

[https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app)

  • Thanks for the response. Unfortunately, I already have background fetch enabled.

Add a Comment

OK, well, I rebooted my phone on a whim, and now it's working.