Class: Grocer::NewsstandNotification

Inherits:
Notification show all
Defined in:
lib/grocer/newsstand_notification.rb

Overview

Public: A specialized form of a Grocer::Notification which requires neither an alert nor badge to be present in the payload. It requires only the ‘device_token` to be set.

Examples

Grocer::NewsstandNotification.new(device_token: '...')
  #=> { aps: { 'content-available' => 1 } }

Constant Summary

Constants inherited from Notification

Grocer::Notification::CONTENT_AVAILABLE_INDICATOR, Grocer::Notification::MAX_PAYLOAD_SIZE

Instance Attribute Summary

Attributes inherited from Notification

#alert, #badge, #category, #content_available, #custom, #device_token, #expiry, #identifier, #sound

Instance Method Summary collapse

Methods inherited from Notification

#content_available?, #to_bytes, #valid?

Constructor Details

#initialize(payload = {}) ⇒ NewsstandNotification

Returns a new instance of NewsstandNotification.



14
15
16
# File 'lib/grocer/newsstand_notification.rb', line 14

def initialize(payload = {})
  super(payload.merge(content_available: true))
end