lib/rapnd/notification.rb in rapnd-0.3.1 vs lib/rapnd/notification.rb in rapnd-0.4.0
- old
+ new
@@ -1,8 +1,8 @@
module Rapnd
class Notification
- attr_accessor :badge, :alert, :sound, :custom_properties, :device_token
+ attr_accessor :badge, :alert, :sound, :'content-available', :custom_properties, :device_token
def initialize(hash)
[:badge, :alert, :sound, :device_token, :custom_properties].each do |k|
self.instance_variable_set("@#{k}".to_sym, hash[k]) if hash[k]
end
@@ -10,10 +10,10 @@
self.device_token = self.device_token.delete(' ')
end
def payload
p = Hash.new
- [:badge, :alert, :sound].each do |k|
+ [:badge, :alert, :sound, :'content-available'].each do |k|
p[k] = send(k) if send(k)
end
aps = {:aps => p}
aps.merge!(custom_properties) if custom_properties
aps
\ No newline at end of file