Class: Firebase::Admin::Messaging::AndroidNotification

Inherits:
Object
  • Object
show all
Defined in:
lib/firebase/admin/messaging/android_notification.rb

Overview

Android-specific notification options that can be included in an AndroidConfig.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title: nil, body: nil, icon: nil, color: nil, sound: nil, tag: nil, image: nil, click_action: nil, body_loc_key: nil, body_loc_args: nil, title_loc_key: nil, title_loc_args: nil, channel_id: nil, ticker: nil, sticky: nil, event_time: nil, local_only: nil, priority: nil, vibrate_timings: nil, default_vibrate_timings: nil, default_sound: nil, light_settings: nil, default_light_settings: nil, visibility: nil, notification_count: nil) ⇒ AndroidNotification

Initializes an AndroidNotification



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/firebase/admin/messaging/android_notification.rb', line 165

def initialize(
  title: nil,
  body: nil,
  icon: nil,
  color: nil,
  sound: nil,
  tag: nil,
  image: nil,
  click_action: nil,
  body_loc_key: nil,
  body_loc_args: nil,
  title_loc_key: nil,
  title_loc_args: nil,
  channel_id: nil,
  ticker: nil,
  sticky: nil,
  event_time: nil,
  local_only: nil,
  priority: nil,
  vibrate_timings: nil,
  default_vibrate_timings: nil,
  default_sound: nil,
  light_settings: nil,
  default_light_settings: nil,
  visibility: nil,
  notification_count: nil
)
  self.title = title
  self.body = body
  self.icon = icon
  self.color = color
  self.sound = sound
  self.tag = tag
  self.image = image
  self.click_action = click_action
  self.body_loc_key = body_loc_key
  self.body_loc_args = body_loc_args
  self.title_loc_key = title_loc_key
  self.title_loc_args = title_loc_args
  self.channel_id = channel_id
  self.ticker = ticker
  self.sticky = sticky
  self.event_time = event_time
  self.local_only = local_only
  self.priority = priority
  self.vibrate_timings = vibrate_timings
  self.default_vibrate_timings = default_vibrate_timings
  self.default_sound = default_sound
  self.light_settings = light_settings
  self.default_light_settings = default_light_settings
  self.visibility = visibility
  self.notification_count = notification_count
end

Instance Attribute Details

#bodyString?



12
13
14
# File 'lib/firebase/admin/messaging/android_notification.rb', line 12

def body
  @body
end

#body_loc_argsArray<String>?



46
47
48
# File 'lib/firebase/admin/messaging/android_notification.rb', line 46

def body_loc_args
  @body_loc_args
end

#body_loc_keyString?



42
43
44
# File 'lib/firebase/admin/messaging/android_notification.rb', line 42

def body_loc_key
  @body_loc_key
end

#channel_idString?



61
62
63
# File 'lib/firebase/admin/messaging/android_notification.rb', line 61

def channel_id
  @channel_id
end

#click_actionString?



38
39
40
# File 'lib/firebase/admin/messaging/android_notification.rb', line 38

def click_action
  @click_action
end

#colorString?



20
21
22
# File 'lib/firebase/admin/messaging/android_notification.rb', line 20

def color
  @color
end

#default_light_settingsBoolean?

Returns If set to ‘true`, use the Android framework’s default LED light settings for the notification. Default values are specified in ‘config.xml`. If `default_light_settings` is set to `true` and `light_settings` is also set, the user-specified `light_settings` is used instead of the default value.



122
123
124
# File 'lib/firebase/admin/messaging/android_notification.rb', line 122

def default_light_settings
  @default_light_settings
end

#default_soundBoolean?

Returns If set to ‘true`, use the Android framework’s default sound for the notification. Default values are specified in ‘config.xml`.



110
111
112
# File 'lib/firebase/admin/messaging/android_notification.rb', line 110

def default_sound
  @default_sound
end

#default_vibrate_timingsBoolean?

Returns If set to ‘true`, use the Android framework’s default vibrate pattern for the notification. Default values are specified in ‘config.xml`. If `default_vibrate_timings` is set to `true` and `vibrate_timings` is also set, the default value is used instead of the user-specified `vibrate_timings`.



104
105
106
# File 'lib/firebase/admin/messaging/android_notification.rb', line 104

def default_vibrate_timings
  @default_vibrate_timings
end

#event_timeTime?



76
77
78
# File 'lib/firebase/admin/messaging/android_notification.rb', line 76

def event_time
  @event_time
end

#iconString?



16
17
18
# File 'lib/firebase/admin/messaging/android_notification.rb', line 16

def icon
  @icon
end

#imageString?



33
34
35
# File 'lib/firebase/admin/messaging/android_notification.rb', line 33

def image
  @image
end

#light_settingsLightSettings?



115
116
117
# File 'lib/firebase/admin/messaging/android_notification.rb', line 115

def light_settings
  @light_settings
end

#local_onlyBoolean?



82
83
84
# File 'lib/firebase/admin/messaging/android_notification.rb', line 82

def local_only
  @local_only
end

#notification_countInteger?

Returns Sets the number of items this notification represents. May be displayed as a badge count for Launchers that support badging. For example, this might be useful if you’re using just one notification to represent multiple new messages but you want the count here to represent the number of total new messages. If zero or unspecified, systems that support badging use the default, which is to increment a number displayed on the long-press menu each time a new notification arrives.



136
137
138
# File 'lib/firebase/admin/messaging/android_notification.rb', line 136

def notification_count
  @notification_count
end

#priorityString?



89
90
91
# File 'lib/firebase/admin/messaging/android_notification.rb', line 89

def priority
  @priority
end

#soundString?



24
25
26
# File 'lib/firebase/admin/messaging/android_notification.rb', line 24

def sound
  @sound
end

#stickyBoolean?



71
72
73
# File 'lib/firebase/admin/messaging/android_notification.rb', line 71

def sticky
  @sticky
end

#tagString?



29
30
31
# File 'lib/firebase/admin/messaging/android_notification.rb', line 29

def tag
  @tag
end

#tickerString?



66
67
68
# File 'lib/firebase/admin/messaging/android_notification.rb', line 66

def ticker
  @ticker
end

#titleString?



8
9
10
# File 'lib/firebase/admin/messaging/android_notification.rb', line 8

def title
  @title
end

#title_loc_argsArray<String>?



54
55
56
# File 'lib/firebase/admin/messaging/android_notification.rb', line 54

def title_loc_args
  @title_loc_args
end

#title_loc_keyString?



50
51
52
# File 'lib/firebase/admin/messaging/android_notification.rb', line 50

def title_loc_key
  @title_loc_key
end

#vibrate_timingsArray<Numeric>?



97
98
99
# File 'lib/firebase/admin/messaging/android_notification.rb', line 97

def vibrate_timings
  @vibrate_timings
end

#visibilityString?



127
128
129
# File 'lib/firebase/admin/messaging/android_notification.rb', line 127

def visibility
  @visibility
end