Silent Push Notification in iOS 7 does not work Silent Push Notification in iOS 7 does not work ios ios

Silent Push Notification in iOS 7 does not work


This works also and does not play a sound when it arrives:

{    aps = {        "content-available" : 1,        sound : ""    };}

EDIT

People having this problem may want to check out this link. I have been participating in a thread on Apple's Developer forum that goes over all app states and when silent pushes are received and not received.


So I just came across this issue yesterday, and after trying sending a payload with a sound set to an empty string, it was still causing vibration/sound on the device. Eventually, I stumbled on a blog post from Urban Airship that suggested needing to send:

{ priority: 5 }

in the push notification, which I had never seen. After perusing Apple's docs for push notifications, I stumbled on this page:

https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html

Which indicates that priority should be set as "5" or "10", and explains:

The notification’s priority. Provide one of the following values:

10 The push message is sent immediately.

The push notification must trigger an alert, sound, or badge on the device. It is an error to use this priority for a push that contains only the content-available key.

5 The push message is sent at a time that conserves power on the device receiving it.

Ultimately, we were able to get silent push notifications working with a badge count (and I suspect you could even do the same with an alert) with the following format:

    aps =     {        badge = 7;        "content-available" = 1;        priority = 5;    };


I have tried setting an empty string as the alert attribute and it also worked:

{    aps =     {        "content-available" = 1;        "alert" = "";    };}

It seems like APNS is checking for the existence of this attributes for the purpose of validating the push payload. Interestingly, they are not checking the actual content. It seems a little bit hacky though...