Class: Apnotic::Notification

Inherits:
AbstractNotification show all
Defined in:
lib/apnotic/notification.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractNotification

#apns_collapse_id, #apns_id, #authorization, #expiration, #priority, #token, #topic

Instance Method Summary collapse

Methods inherited from AbstractNotification

#authorization_header, #body, #initialize

Constructor Details

This class inherits a constructor from Apnotic::AbstractNotification

Instance Attribute Details

#alertObject

Returns the value of attribute alert.



6
7
8
# File 'lib/apnotic/notification.rb', line 6

def alert
  @alert
end

#badgeObject

Returns the value of attribute badge.



6
7
8
# File 'lib/apnotic/notification.rb', line 6

def badge
  @badge
end

#categoryObject

Returns the value of attribute category.



6
7
8
# File 'lib/apnotic/notification.rb', line 6

def category
  @category
end

#content_availableObject

Returns the value of attribute content_available.



6
7
8
# File 'lib/apnotic/notification.rb', line 6

def content_available
  @content_available
end

#custom_payloadObject

Returns the value of attribute custom_payload.



6
7
8
# File 'lib/apnotic/notification.rb', line 6

def custom_payload
  @custom_payload
end

#mutable_contentObject

Returns the value of attribute mutable_content.



6
7
8
# File 'lib/apnotic/notification.rb', line 6

def mutable_content
  @mutable_content
end

#soundObject

Returns the value of attribute sound.



6
7
8
# File 'lib/apnotic/notification.rb', line 6

def sound
  @sound
end

#thread_idObject

Returns the value of attribute thread_id.



6
7
8
# File 'lib/apnotic/notification.rb', line 6

def thread_id
  @thread_id
end

#url_argsObject

Returns the value of attribute url_args.



6
7
8
# File 'lib/apnotic/notification.rb', line 6

def url_args
  @url_args
end

Instance Method Details

#background_notification?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/apnotic/notification.rb', line 8

def background_notification?
  aps.count == 1 && aps.key?('content-available') && aps['content-available'] == 1
end