I'm using this gem https://github.com/justintv/APNS to send push
notifications to an iPhone app and amazingly it works for single
notifications, such that I can do...
I'm using this gem https://github.com/justintv/APNS to send push
notifications to an iPhone app and amazingly it works for single
notifications, such that I can do...
Have you tried that? It doesn't look like valid ruby to me (even with
the missing ] on the end of n1)
#####
for me it's slightly different, I wish to loop through each device in my
db and then send the same message to them all...it's something like this
but it's clearly not quite right... can't get the :aps => thing to work
out.
I think I need something like this on my Device model, but it's not
right - please help correct it, would greatly appreciate.
def self.push_message_to_all(message)
devices = self.all
notifications =
devices.each do |device|
notifications << [device.device_token,message]
end
Once you have got the manual example above working the use ruby-debug
to break in here and have a look at notifications and see if it is of
the same form as if you break into the manual test and look at it
there.