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, #push_type, #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

#content_stateObject

Returns the value of attribute content_state.



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

def content_state
  @content_state
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

#dismissal_dateObject

Returns the value of attribute dismissal_date.



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

def dismissal_date
  @dismissal_date
end

#eventObject

Returns the value of attribute event.



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

def event
  @event
end

#interruption_levelObject

Returns the value of attribute interruption_level.



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

def interruption_level
  @interruption_level
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

#relevance_scoreObject

Returns the value of attribute relevance_score.



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

def relevance_score
  @relevance_score
end

#soundObject

Returns the value of attribute sound.



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

def sound
  @sound
end

#stale_dateObject

Returns the value of attribute stale_date.



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

def stale_date
  @stale_date
end

#target_content_idObject

Returns the value of attribute target_content_id.



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

def target_content_id
  @target_content_id
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

#timestampObject

Returns the value of attribute timestamp.



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

def timestamp
  @timestamp
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)


10
11
12
# File 'lib/apnotic/notification.rb', line 10

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