Net::APNS - Apple Push Notification Service for perl.


Net-APNS documentation Contained in the Net-APNS distribution.

Index


Code Index:

NAME

Top

Net::APNS - Apple Push Notification Service for perl.

SYNOPSIS

Top

  use Net::APNS;
  my $APNS = Net::APNS->new;
  my $Notifier = $APNS->notify({
      cert   => "cert.pem",
      key    => "key.pem",
      passwd => "pass"
  });
  $Notifier->devicetoken("....");
  $Notifier->message("message");
  $Notifier->badge(4);
  $Notifier->write;

DESCRIPTION

Top

Net::APNS is Apple Push Notification Service. Push message to iPhone and get unavalble-devicetoken.

METHOD

Top

notify()

Return push client. Need specify parameters.

PARAMETERS

Cert

Server certification file.

Key

Server certification key file.

passwd

certification password. (option)

PUSH

Payload contains message, badge and more.

  $APNS->devicetoken($devicetoken);
  $APNS->write({
      sandbox => $sandbox,
      message => $message,
      badge   => $badge,
  });

or

  $APNS->devicetoken($devicetoken);
  $APNS->sandbox($sandbox);
  $APNS->message($message);
  $APNS->badge($badge);
  $APNS->write;

AUTHOR

Top

haoyayoi <st.hao.yayoi@gmail.com>

SEE ALSO

Top

Net::APNS::Notification

LICENSE

Top

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


Net-APNS documentation Contained in the Net-APNS distribution.

package Net::APNS;
use strict;
use warnings;
use Net::APNS::Notification;
use Sub::Exporter -setup => {
    exports => [ qw/notify/ ],
};
our $VERSION = '0.0201';

sub new { bless {}, $_[0]; }

sub notify {
    my ( $self, $args ) = @_;
    return Net::APNS::Notification->new(
        cert   => $args->{cert},
        key    => $args->{key},
        passwd => $args->{passwd},
    );
}

1;
__END__