silent push notifications on simulator

I'm working on an app that makes use of both regular (visible) push notifications and silent push notifications. Both types are working fine on a device, but only the regular type is working in the simulator. I'm sending the same test payloads to both the device and simulator.

To be more specific, I use this payload for a silent push notification:

Code Block
{
"aps": {
"content-available": 1
},
"Simulator Target Bundle": "com.mycompany.MyApp"
}

And I try to send this payload to the simulator with this command:
Code Block
xcrun simctl push booted com.mycompany.MyApp silent.apns

As far as I can see, the app in the simulator does not respond to this silent push notification, but the app on a device does when running both in the foreground and background.

Is this a known issue? If so, has anybody been able to get this to work? Or are silent push notifications just not supported on the simulator (yet)?

Post not yet marked as solved Up vote post of jayatimp Down vote post of jayatimp
3.1k views

Replies

I believe this is a known issue - I have never expected silent push to work on the simulator.
I have the same problem.

Broken for me as well. How is this not a priority? Also, seems like more like a bug, not a deliberate lack of a feature?

XCode 14 advertises testing real push messages on a simulator. Please, make this actually the case, it's necessary.