Class: Google::Apis::FcmV1::AndroidNotification

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

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

#bodyString

The notification's body text. If present, it will override google.firebase.fcm.v1.Notification.body. Corresponds to the JSON property body

Returns:

  • (String)


124
125
126
# File 'generated/google/apis/fcm_v1/classes.rb', line 124

def body
  @body
end

#body_loc_argsArray<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

Returns:

  • (Array<String>)


132
133
134
# File 'generated/google/apis/fcm_v1/classes.rb', line 132

def body_loc_args
  @body_loc_args
end

#body_loc_keyString

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

Returns:

  • (String)


139
140
141
# File 'generated/google/apis/fcm_v1/classes.rb', line 139

def body_loc_key
  @body_loc_key
end

#channel_idString

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

Returns:

  • (String)


151
152
153
# File 'generated/google/apis/fcm_v1/classes.rb', line 151

def channel_id
  @channel_id
end

#click_actionString

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

Returns:

  • (String)


158
159
160
# File 'generated/google/apis/fcm_v1/classes.rb', line 158

def click_action
  @click_action
end

#colorString

The notification's icon color, expressed in #rrggbb format. Corresponds to the JSON property color

Returns:

  • (String)


163
164
165
# File 'generated/google/apis/fcm_v1/classes.rb', line 163

def color
  @color
end

#iconString

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

Returns:

  • (String)


171
172
173
# File 'generated/google/apis/fcm_v1/classes.rb', line 171

def icon
  @icon
end

#imageString

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

Returns:

  • (String)


178
179
180
# File 'generated/google/apis/fcm_v1/classes.rb', line 178

def image
  @image
end

#soundString

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

Returns:

  • (String)


185
186
187
# File 'generated/google/apis/fcm_v1/classes.rb', line 185

def sound
  @sound
end

#tagString

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

Returns:

  • (String)


194
195
196
# File 'generated/google/apis/fcm_v1/classes.rb', line 194

def tag
  @tag
end

#titleString

The notification's title. If present, it will override google.firebase.fcm.v1.Notification.title. Corresponds to the JSON property title

Returns:

  • (String)


200
201
202
# File 'generated/google/apis/fcm_v1/classes.rb', line 200

def title
  @title
end

#title_loc_argsArray<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

Returns:

  • (Array<String>)


208
209
210
# File 'generated/google/apis/fcm_v1/classes.rb', line 208

def title_loc_args
  @title_loc_args
end

#title_loc_keyString

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

Returns:

  • (String)


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