Class: MobileNotify::Apns::BadgeNotification

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, badge_value, sound = nil) ⇒ BadgeNotification

Returns a new instance of BadgeNotification.



49
50
51
52
53
54
# File 'lib/mobile_notify/apns/notification.rb', line 49

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