Method: APN::Notification#payload

Defined in:
lib/apn/notification.rb

#payloadObject



13
14
15
16
17
18
19
20
21
# File 'lib/apn/notification.rb', line 13

def payload
  p = Hash.new
  [:badge, :alert, :sound, :content_available].each do |k|
    p[k.to_s.gsub('_','-').to_sym] = send(k) if send(k)
  end
  aps = {:aps => p}
  aps.merge!(custom_properties) if custom_properties
  aps
end