AnyEvent::APNS is a Perl module that helps you to create Apple Push Notifications Service (APNS) Provider.
SYNOPSIS
use AnyEvent::APNS;
my $cv = AnyEvent->condvar;
my $apns; $apns = AnyEvent::APNS->new(
certificate => 'your apns certificate file',
private_key => 'your apns private key file',
sandbox => 1,
on_error => sub { # something went wrong },
on_connect => sub {
$apns->send( $device_token => {
aps => {
alert => 'Message received from Bob',
},
});
},
);
$apns->connect;
# disconnect and exit program as soon as possible after sending a message
# otherwise $apns makes persistent connection with apns server
$apns->handler->on_drain(sub {
undef $_[0];
$cv->send;
});
$cv->recv;
Product's homepage
Requirements:
· Perl