Class: ActionPush::Ios::Message
- Inherits:
-
Provider::Base
- Object
- Provider::Base
- ActionPush::Ios::Message
- Defined in:
- lib/action_push/ios/message.rb
Instance Attribute Summary collapse
-
#badge ⇒ Object
- Integer
-
Include this key when you want the system to modify the badge of your app icon.
-
#category ⇒ Object
- String
-
Provide this key with a string value that represents the notification’s type.
-
#content_available ⇒ Object
- Integer
-
Include this key with a value of 1 to configure a background update notification.
-
#sound ⇒ Object
- String
-
Include this key when you want the system to play a sound.
-
#thread_id ⇒ Object
- String
-
Provide this key with a string value that represents the app-specific identifier for grouping notifications.
Attributes inherited from Provider::Base
#delivered, #delivery_method, #delivery_response, #payload, #scheduled, #token
Instance Method Summary collapse
- #alert ⇒ Object
- #alert=(alert) ⇒ Object
- #body ⇒ Object
- #body=(value) ⇒ Object
- #title ⇒ Object
- #title=(value) ⇒ Object
Methods inherited from Provider::Base
#assign, #deliver, #initialize
Constructor Details
This class inherits a constructor from ActionPush::Provider::Base
Instance Attribute Details
#badge ⇒ Object
- Integer
-
Include this key when you want the system to modify the badge of your app icon. If this key is not included in the dictionary, the badge is not changed. To remove the badge, set the value of this key to 0.
11 12 13 |
# File 'lib/action_push/ios/message.rb', line 11 def badge @badge end |
#category ⇒ Object
- String
-
Provide this key with a string value that represents the notification’s type. This value corresponds to the value in the identifier
27 28 29 |
# File 'lib/action_push/ios/message.rb', line 27 def category @category end |
#content_available ⇒ Object
- Integer
-
Include this key with a value of 1 to configure a background update notification. When this key is present, the system wakes up your app in the background and delivers the notification to its app delegate
22 23 24 |
# File 'lib/action_push/ios/message.rb', line 22 def content_available @content_available end |
#sound ⇒ Object
- String
-
Include this key when you want the system to play a sound. The value of this key is the name of a sound file in your app’s main bundle or in the Library/Sounds
16 17 18 |
# File 'lib/action_push/ios/message.rb', line 16 def sound @sound end |
#thread_id ⇒ Object
- String
-
Provide this key with a string value that represents the app-specific identifier for grouping notifications
32 33 34 |
# File 'lib/action_push/ios/message.rb', line 32 def thread_id @thread_id end |
Instance Method Details
#alert ⇒ Object
42 43 44 45 |
# File 'lib/action_push/ios/message.rb', line 42 def alert @alert ||= Alert.new block_given? ? yield(@alert) : @alert end |
#alert=(alert) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/action_push/ios/message.rb', line 34 def alert=(alert) unless alert.is_a?(Alert) raise ArgumentError, "alert should be an instance of #{Alert}, got: <#{alert.class}>" end @alert = alert end |
#body ⇒ Object
59 60 61 |
# File 'lib/action_push/ios/message.rb', line 59 def body alert.body end |
#body=(value) ⇒ Object
51 52 53 |
# File 'lib/action_push/ios/message.rb', line 51 def body=(value) alert.body = value end |
#title ⇒ Object
55 56 57 |
# File 'lib/action_push/ios/message.rb', line 55 def title alert.title end |
#title=(value) ⇒ Object
47 48 49 |
# File 'lib/action_push/ios/message.rb', line 47 def title=(value) alert.title = value end |