Class: Google::Apis::FcmV1::AndroidNotification
- Inherits:
-
Object
- Object
- Google::Apis::FcmV1::AndroidNotification
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/fcm_v1/classes.rb,
generated/google/apis/fcm_v1/representations.rb,
generated/google/apis/fcm_v1/representations.rb
Overview
Notification to send to android devices.
Instance Attribute Summary collapse
-
#body ⇒ String
The notification's body text.
-
#body_loc_args ⇒ Array<String>
Variable string values to be used in place of the format specifiers in body_loc_key to use to localize the body text to the user's current localization.
-
#body_loc_key ⇒ String
The key to the body string in the app's string resources to use to localize the body text to the user's current localization.
-
#channel_id ⇒ String
The notification's channel id (new in Android O).
-
#click_action ⇒ String
The action associated with a user click on the notification.
-
#color ⇒ String
The notification's icon color, expressed in #rrggbb format.
-
#icon ⇒ String
The notification's icon.
-
#image ⇒ String
Contains the URL of an image that is going to be displayed in a notification.
-
#sound ⇒ String
The sound to play when the device receives the notification.
-
#tag ⇒ String
Identifier used to replace existing notifications in the notification drawer.
-
#title ⇒ String
The notification's title.
-
#title_loc_args ⇒ Array<String>
Variable string values to be used in place of the format specifiers in title_loc_key to use to localize the title text to the user's current localization.
-
#title_loc_key ⇒ String
The key to the title string in the app's string resources to use to localize the title text to the user's current localization.
Instance Method Summary collapse
-
#initialize(**args) ⇒ AndroidNotification
constructor
A new instance of AndroidNotification.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ AndroidNotification
Returns a new instance of AndroidNotification
217 218 219 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 217 def initialize(**args) update!(**args) end |
Instance Attribute Details
#body ⇒ String
The notification's body text. If present, it will override
google.firebase.fcm.v1.Notification.body.
Corresponds to the JSON property body
124 125 126 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 124 def body @body end |
#body_loc_args ⇒ Array<String>
Variable string values to be used in place of the format specifiers in
body_loc_key to use to localize the body text to the user's current
localization.
See Formatting and Styling for more information.
Corresponds to the JSON property bodyLocArgs
132 133 134 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 132 def body_loc_args @body_loc_args end |
#body_loc_key ⇒ String
The key to the body string in the app's string resources to use to localize
the body text to the user's current localization.
See String Resources for more information.
Corresponds to the JSON property bodyLocKey
139 140 141 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 139 def body_loc_key @body_loc_key end |
#channel_id ⇒ String
The notification's channel
id
(new in Android O). The app must create a channel with this channel ID
before any notification with this channel ID is received. If you don't send
this channel ID in the request, or if the channel ID provided has not yet
been created by the app, FCM uses the channel ID specified in the app
manifest.
Corresponds to the JSON property channelId
151 152 153 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 151 def channel_id @channel_id end |
#click_action ⇒ String
The action associated with a user click on the notification.
If specified, an activity with a matching intent filter is launched when
a user clicks on the notification.
Corresponds to the JSON property clickAction
158 159 160 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 158 def click_action @click_action end |
#color ⇒ String
The notification's icon color, expressed in #rrggbb format.
Corresponds to the JSON property color
163 164 165 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 163 def color @color end |
#icon ⇒ String
The notification's icon.
Sets the notification icon to myicon for drawable resource myicon.
If you don't send this key in the request, FCM displays the launcher icon
specified in your app manifest.
Corresponds to the JSON property icon
171 172 173 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 171 def icon @icon end |
#image ⇒ String
Contains the URL of an image that is going to be displayed in a
notification. If present, it will override
google.firebase.fcm.v1.Notification.image.
Corresponds to the JSON property image
178 179 180 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 178 def image @image end |
#sound ⇒ String
The sound to play when the device receives the notification.
Supports "default" or the filename of a sound resource bundled in the app.
Sound files must reside in /res/raw/.
Corresponds to the JSON property sound
185 186 187 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 185 def sound @sound end |
#tag ⇒ String
Identifier used to replace existing notifications in the notification
drawer.
If not specified, each request creates a new notification.
If specified and a notification with the same tag is already being shown,
the new notification replaces the existing one in the notification drawer.
Corresponds to the JSON property tag
194 195 196 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 194 def tag @tag end |
#title ⇒ String
The notification's title. If present, it will override
google.firebase.fcm.v1.Notification.title.
Corresponds to the JSON property title
200 201 202 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 200 def title @title end |
#title_loc_args ⇒ Array<String>
Variable string values to be used in place of the format specifiers in
title_loc_key to use to localize the title text to the user's current
localization.
See Formatting and Styling for more information.
Corresponds to the JSON property titleLocArgs
208 209 210 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 208 def title_loc_args @title_loc_args end |
#title_loc_key ⇒ String
The key to the title string in the app's string resources to use to
localize the title text to the user's current localization.
See String Resources for more information.
Corresponds to the JSON property titleLocKey
215 216 217 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 215 def title_loc_key @title_loc_key end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'generated/google/apis/fcm_v1/classes.rb', line 222 def update!(**args) @body = args[:body] if args.key?(:body) @body_loc_args = args[:body_loc_args] if args.key?(:body_loc_args) @body_loc_key = args[:body_loc_key] if args.key?(:body_loc_key) @channel_id = args[:channel_id] if args.key?(:channel_id) @click_action = args[:click_action] if args.key?(:click_action) @color = args[:color] if args.key?(:color) @icon = args[:icon] if args.key?(:icon) @image = args[:image] if args.key?(:image) @sound = args[:sound] if args.key?(:sound) @tag = args[:tag] if args.key?(:tag) @title = args[:title] if args.key?(:title) @title_loc_args = args[:title_loc_args] if args.key?(:title_loc_args) @title_loc_key = args[:title_loc_key] if args.key?(:title_loc_key) end |