SendMessage constructor

SendMessage({
  1. required String destinationId,
  2. required String messageId,
  3. int? timeToLive,
  4. required Map data,
})

Implementation

SendMessage({
  /// The ID of the server to send the message to as assigned by [Google API
  /// Console](https://console.cloud.google.com/apis/dashboard).
  required String destinationId,

  /// The ID of the message. It must be unique for each message in scope of
  /// the applications. See the [Cloud Messaging
  /// documentation](https://firebase.google.com/docs/cloud-messaging/js/client)
  /// for advice for picking and handling an ID.
  required String messageId,

  /// Time-to-live of the message in seconds. If it is not possible to send
  /// the message within that time, an onSendError event will be raised. A
  /// time-to-live of 0 indicates that the message should be sent immediately
  /// or fail if it's not possible. The default value of time-to-live is
  /// 86,400 seconds (1 day) and the maximum value is 2,419,200 seconds (28
  /// days).
  int? timeToLive,

  /// Message data to send to the server. Case-insensitive `goog.` and
  /// `google`, as well as case-sensitive `collapse_key` are disallowed as key
  /// prefixes. Sum of all key/value pairs should not exceed
  /// [gcm.MAX_MESSAGE_SIZE].
  required Map data,
}) : _wrapped = $js.SendMessage(
        destinationId: destinationId,
        messageId: messageId,
        timeToLive: timeToLive,
        data: data.jsify()!,
      );