lib/rapnd/notification.rb in rapnd-0.2.1 vs lib/rapnd/notification.rb in rapnd-0.2.2

- old
+ new

@@ -1,11 +1,11 @@ module Rapnd class Notification - attr_accessor :badge, :alert, :sound, :custom, :device_token + attr_accessor :badge, :alert, :sound, :custom_properties, :device_token def initialize(hash) - [:badge, :alert, :sound, :device_token, :custom].each do |k| + [:badge, :alert, :sound, :device_token, :custom_properties].each do |k| self.instance_variable_set("@#{k}".to_sym, hash[k]) if hash[k] end raise "Must provide device token: #{hash}" if self.device_token.nil? self.device_token = self.device_token.delete(' ') end @@ -14,10 +14,10 @@ p = Hash.new [:badge, :alert, :sound].each do |k| p[k] = send(k) if send(k) end aps = {:aps => p} - aps.merge!(custom) if custom + aps.merge!(custom_properties) if custom_properties aps end def json_payload j = ActiveSupport::JSON.encode(payload) \ No newline at end of file