Class: Google::Apis::FcmV1::Message
- Inherits:
-
Object
- Object
- Google::Apis::FcmV1::Message
- 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
Message to send by Firebase Cloud Messaging Service.
Instance Attribute Summary collapse
-
#android ⇒ Google::Apis::FcmV1::AndroidConfig
Android specific options for messages sent through FCM connection server.
-
#apns ⇒ Google::Apis::FcmV1::ApnsConfig
Apple Push Notification Service specific options.
-
#condition ⇒ String
Condition to send a message to, e.g.
-
#data ⇒ Hash<String,String>
Input only.
-
#fcm_options ⇒ Google::Apis::FcmV1::FcmOptions
Platform independent options for features provided by the FCM SDKs.
-
#name ⇒ String
Output Only.
-
#notification ⇒ Google::Apis::FcmV1::Notification
Basic notification template to use across all platforms.
-
#token ⇒ String
Registration token to send a message to.
-
#topic ⇒ String
Topic name to send a message to, e.g.
-
#webpush ⇒ Google::Apis::FcmV1::WebpushConfig
Webpush protocol options.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Message
constructor
A new instance of Message.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Message
Returns a new instance of Message.
702 703 704 |
# File 'lib/google/apis/fcm_v1/classes.rb', line 702 def initialize(**args) update!(**args) end |
Instance Attribute Details
#android ⇒ Google::Apis::FcmV1::AndroidConfig
Android specific options for messages sent through FCM connection server.
Corresponds to the JSON property android
648 649 650 |
# File 'lib/google/apis/fcm_v1/classes.rb', line 648 def android @android end |
#apns ⇒ Google::Apis::FcmV1::ApnsConfig
Apple Push Notification Service specific options.
Corresponds to the JSON property apns
653 654 655 |
# File 'lib/google/apis/fcm_v1/classes.rb', line 653 def apns @apns end |
#condition ⇒ String
Condition to send a message to, e.g. "'foo' in topics && 'bar' in topics".
Corresponds to the JSON property condition
658 659 660 |
# File 'lib/google/apis/fcm_v1/classes.rb', line 658 def condition @condition end |
#data ⇒ Hash<String,String>
Input only. Arbitrary key/value payload, which must be UTF-8 encoded. The key
should not be a reserved word ("from", "message_type", or any word starting
with "google." or "gcm.notification."). When sending payloads containing only
data fields to iOS devices, only normal priority ("apns-priority": "5"
) is
allowed in ApnsConfig
.
Corresponds to the JSON property data
668 669 670 |
# File 'lib/google/apis/fcm_v1/classes.rb', line 668 def data @data end |
#fcm_options ⇒ Google::Apis::FcmV1::FcmOptions
Platform independent options for features provided by the FCM SDKs.
Corresponds to the JSON property fcmOptions
673 674 675 |
# File 'lib/google/apis/fcm_v1/classes.rb', line 673 def @fcm_options end |
#name ⇒ String
Output Only. The identifier of the message sent, in the format of projects/*/
messages/
message_id`.
Corresponds to the JSON property
name`
679 680 681 |
# File 'lib/google/apis/fcm_v1/classes.rb', line 679 def name @name end |
#notification ⇒ Google::Apis::FcmV1::Notification
Basic notification template to use across all platforms.
Corresponds to the JSON property notification
684 685 686 |
# File 'lib/google/apis/fcm_v1/classes.rb', line 684 def notification @notification end |
#token ⇒ String
Registration token to send a message to.
Corresponds to the JSON property token
689 690 691 |
# File 'lib/google/apis/fcm_v1/classes.rb', line 689 def token @token end |
#topic ⇒ String
Topic name to send a message to, e.g. "weather". Note: "/topics/" prefix
should not be provided.
Corresponds to the JSON property topic
695 696 697 |
# File 'lib/google/apis/fcm_v1/classes.rb', line 695 def topic @topic end |
#webpush ⇒ Google::Apis::FcmV1::WebpushConfig
Webpush protocol options.
Corresponds to the JSON property webpush
700 701 702 |
# File 'lib/google/apis/fcm_v1/classes.rb', line 700 def webpush @webpush end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
707 708 709 710 711 712 713 714 715 716 717 718 |
# File 'lib/google/apis/fcm_v1/classes.rb', line 707 def update!(**args) @android = args[:android] if args.key?(:android) @apns = args[:apns] if args.key?(:apns) @condition = args[:condition] if args.key?(:condition) @data = args[:data] if args.key?(:data) @fcm_options = args[:fcm_options] if args.key?(:fcm_options) @name = args[:name] if args.key?(:name) @notification = args[:notification] if args.key?(:notification) @token = args[:token] if args.key?(:token) @topic = args[:topic] if args.key?(:topic) @webpush = args[:webpush] if args.key?(:webpush) end |