Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert field #105

Closed
federicolucca opened this issue Aug 28, 2015 · 1 comment
Closed

Alert field #105

federicolucca opened this issue Aug 28, 2015 · 1 comment

Comments

@federicolucca
Copy link

Hi,

I need to do something like this in a push notification.

{
  "aps" : {
    "alert" : {
      "title" : "Titolo della news",
      "body" : "Testo della news",
      "action-loc-key" : "NEWS"
    },
  "badge" : 1,
  },
}

i use this call to create a new one.Can i put the json in the field alert?

notification = Grocer::Notification.new(
              device_token:      device.device_token,
              alert:             message,
              badge:             1,
              category:          "a category",         # optional; used for custom notification actions
              sound:             "siren.aiff",         # optional
              expiry:            Time.now,     # optional; 0 is default, meaning the message is not stored
              identifier:        1234,                 # optional; must be an integer
              custom:            {:titolo =>notification_in.titolo,:testo=>notification_in.testo}   # optional; any truthy value will set 'content-available' to 1
            )

Thanks to everyone
Federico

@stevenharman
Copy link
Member

Hello @federicolucca,

Have you tried this? If so, what was the result?

I'm going to close this for now, but feel free to re-open if you're still having the issue and need further assistance.

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

No branches or pull requests

2 participants