Yuji Shimada > WWW-Google-Cloud-Messaging-0.02 > WWW::Google::Cloud::Messaging::Response

Download:
WWW-Google-Cloud-Messaging-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source   Latest Release: WWW-Google-Cloud-Messaging-0.04

NAME ^

WWW::Google::Cloud::Messaging::Response - An accessor of GCM response data

SYNOPSIS ^

  my $res = $gcm->send({ ... });
  die $res->error unless $res->is_success;

  say $res->multicast_id;
  say $res->success;
  say $res->failure;
  say $res->canonical_ids;

  # get WWW::Google::Cloud::Messaging::Response::ResultSet
  my $results = $res->results;

DESCRIPTION ^

WWW::Google::Cloud::Messaging::Response is an accessor of GCM response data.

METHODS ^

new($http_response)

Create a WWW::Google::Cloud::Messaging::Response. This method used on WWW::Google::Cloud::Messaging internal.

is_success()

Returns a success / failure of the request.

error()

Returns error message if failure of the request.

multicast_id()

success()

Number of messages that were processed without an error.

failure()

Number of messages that could not be processed.

canonical_ids()

Number of results that contain a canonical registration ID.

SEE ALSO http://developer.android.com/guide/google/gcm/adv.html#canonical.

results()

Returns WWW::Google::Cloud::Messaging::Response::ResultSet instance if success of the request.

  my $results = $res->results;
  while (my $result = $results->next) {
      ...
  }

AUTHOR ^

xaicron <xaicron@cpan.org>

COPYRIGHT ^

Copyright 2012 - xaicron

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

WWW::Google::Cloud::Messaging

syntax highlighting: