MMiroslav MMiroslav - 14 days ago 7
iOS Question

How to send silent push to iOS via Google Cloud Messaging

How to send silent push notification to iOS application over GCM?

Silent push is notification that will not appear in notification center, but awake application to do some action in background.
Google introduce new features in new GCM with possibility to send push messages to Android, Chrome and iOS.

Any idea, how to do this?

Answer

Use the content_available (not content-available) attribute like this:

curl -X POST --header "Content-Type:application/json" --header "Authorization:key=AIzaXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" "https://android.googleapis.com/gcm/send" --data-ascii '{"data":{"xxx":"yyy"},"content_available":true,"to":"XXXXXXXXXX:YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY-ZZZZZZZZZZZZZZZZZZZZ"}'