Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Silent Push Notification #37

Open
p581581 opened this issue Jan 13, 2015 · 5 comments
Open

Silent Push Notification #37

p581581 opened this issue Jan 13, 2015 · 5 comments

Comments

@p581581
Copy link

p581581 commented Jan 13, 2015

Hi jpoz,

I'm trying to use silent push notification, and it seen need to provide the key "content-available" with a value of 1, so that I can use it. But, when I write:

APNS.send_notification(device_token, :content-available => 1}

It'll send a syntax error message. How can I solve it?

@eplewis89
Copy link

Hi p581581

Check your parenthesis

APNS.send_notification(device_token, :content-available => 1}
vs
APNS.send_notification(device_token, :content-available => 1)

@sebromero
Copy link

You have to use an underscore instead of a dash
APNS.send_notification(device_token, :content_available => 1)

@sarmiena
Copy link

@sbhklr interesting behavior we noticed with underscore actually. Apple won't deliver the message if we use the underscore option. However, 'content-available' doesn't do what it's supposed to do if we pass that.

@sebromero
Copy link

@sarmiena Works for me. If you pass the symbol :content_available => 1 as a parameter the script sends "content-available" under the hood. Have a look at the source code.

@suvarnakanade
Copy link

@sbhklr its works for me as well. Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants