Class: Google::Apis::FcmV1::Notification

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/fcm_v1/classes.rb,
lib/google/apis/fcm_v1/representations.rb,
lib/google/apis/fcm_v1/representations.rb

Overview

Basic notification template to use across all platforms.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Notification

Returns a new instance of Notification.



729
730
731
# File 'lib/google/apis/fcm_v1/classes.rb', line 729

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#bodyString

The notification's body text. Corresponds to the JSON property body

Returns:

  • (String)


712
713
714
# File 'lib/google/apis/fcm_v1/classes.rb', line 712

def body
  @body
end

#imageString

Contains the URL of an image that is going to be downloaded on the device and displayed in a notification. JPEG, PNG, BMP have full support across platforms. Animated GIF and video only work on iOS. WebP and HEIF have varying levels of support across platforms and platform versions. Android has 1MB image size limit. Quota usage and implications/costs for hosting image on Firebase Storage: https://firebase.google.com/pricing Corresponds to the JSON property image

Returns:

  • (String)


722
723
724
# File 'lib/google/apis/fcm_v1/classes.rb', line 722

def image
  @image
end

#titleString

The notification's title. Corresponds to the JSON property title

Returns:

  • (String)


727
728
729
# File 'lib/google/apis/fcm_v1/classes.rb', line 727

def title
  @title
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



734
735
736
737
738
# File 'lib/google/apis/fcm_v1/classes.rb', line 734

def update!(**args)
  @body = args[:body] if args.key?(:body)
  @image = args[:image] if args.key?(:image)
  @title = args[:title] if args.key?(:title)
end