PushEvent class abstract

Pub/Sub push event.

This class can be used in a HTTP server for decoding messages pushed to an endpoint.

When a message is received on a push endpoint use the PushEvent.fromJson constructor with the HTTP body to decode the received message.

E.g. with a dart:io HTTP handler:

void pushHandler(HttpRequest request) {
  // Decode the JSON body.
  request.transform(UTF8.decoder).join('').then((body) {
    // Decode the JSON into a push message.
    var message = new PushMessage.fromJson(body)

    // Process the message...

    // Respond with status code 20X to acknowledge the message.
    response.statusCode = statusCode;
    response.close();
  });
}

/

Constructors

PushEvent.fromJson(String json)
Create a PushMessage from JSON received on a Pub/Sub push endpoint.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
message Message
The message content.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subscriptionName String
The absolute name of the subscription.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited