Yuji Shimada > WWW-Google-Cloud-Messaging-0.03 > WWW::Google::Cloud::Messaging::Response::Result

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

Dependencies

Annotate this POD

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

NAME ^

WWW::Google::Cloud::Messaging::Response::ResultSet - An accessor of result data.

SYNOPSIS ^

  my $results = $res->results;
  while (my $result = $results->next) {
      my $reg_id = $result->target_reg_id;
      if ($result->is_success) {
          say sprintf 'message_id: %s, reg_id: %s',
              $result->message_id, $reg_id;
      }
      else {
          warn sprintf 'error: %s, reg_id: %s',
              $result->error, $reg_id;
      }

      if ($result->has_canonical_id) {
          say sprintf 'reg_id %s is old! refreshed reg_id is %s',
              $reg_id, $result->registration_id;'
      }
  }

DESCRIPTION ^

WWW::Google::Cloud::Messaging::Response::Result is an accessor of result data.

METHODS ^

new($result)

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

is_success()

Returns true if do not have error field.

message_id()

String representing the message when it was successfully processed.

error()

String describing an error that occurred while processing the message for that recipient.

For more information, please check http://developer.android.com/guide/google/gcm/gcm.html#error_codes.

registration_id()

If set, means that GCM processed the message but it has another canonical registration ID for that device.

has_canonical_id()

Returns true if contain the registration_id field.

target_reg_id()

Return the registration id that associated with this response. This value is one of the registration_ids field specified at the time of request.

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: