Class: MobileNotify::Apns::AlertNotification

Inherits:
Notification show all
Defined in:
lib/mobile_notify/apns/notification.rb

Constant Summary

Constants inherited from Notification

Notification::MAX_PAYLOAD_LENGTH

Instance Method Summary collapse

Methods inherited from Notification

parse, #to_data, #valid?

Constructor Details

#initialize(device_token, alert, sound = nil) ⇒ AlertNotification

Returns a new instance of AlertNotification.



40
41
42
43
44
45
# File 'lib/mobile_notify/apns/notification.rb', line 40

def initialize(device_token, alert, sound = nil)
  payload = { "aps" => {} }
  payload["aps"]["alert"] = alert
  payload["aps"]["sound"] = sound if sound
  super(device_token, payload)
end