In the WWDC 2013's "What's New with Multitasking" presentation, there is a section about Silent Push Notifications. It seems straight forward. According to the presentation, if you send the APS payload with just the content-available set to 1, users will not be notified of the notification.
// A. This doesn't work
{
aps: {
content-available: 1
}
}
My testing shows that this does not work as no push is received. But if I include the sound attribute but exclude the alert attribute, it works (though not silent anymore).
// B. This works
{
aps: {
content-available: 1,
sound: "default"
}
}
However, if I change the sound attribute to play a silent audio, I can mimic a silent push.
// C. This works too.
{
aps: {
content-available: 1,
sound: "silence.wav"
}
}
Does anyone know:
- If this a bug?
- And if it is correct to assume that B or C is being treated as a Remote Notification (and not a bug with Silent Push where you need a sound attribute)? If so, this means it is not rate limited like Silent Pushes are... which Apple will likely fix. So I probably should not rely on it.
- What the rate limit is (N pushes every X seconds, etc)?
Thanks in advance.
Edit with more information
For A, the state of the application does not matter. Notification is never received.
It seems like B and C only work if you enclose the attributes and values in quotes, like below.
{"aps":{"content-available": 1, "sound":"silent.wav"}}
And the notification arrives in application:didReceiveRemoteNotification:fetchCompletionHandler: regardless of state.
Background fetch
checkbox inProject Capabilities
>Background Modes
because the first option should work. Silent push doesnt need a sound attribute and always arrives inapplication:didReceiveRemoteNotification:fetchCompletionHandler:
even if the application is running in background / foreground or not running. – IgniteCoders