Net::APNs::Extended - Client library for APNs that support the extended format.
use Net::APNs::Extended; my $apns = Net::APNs::Extended->new( is_sandbox => 1, cert_file => 'apns.pem', ); # send notification to APNs $apns->send($device_token, { aps => { alert => "Hello, APNs!", badge => 1, sound => "default", }, foo => [qw/bar baz/], }); # if you want to handle the error if (my $error = $apns->retrive_error) { die Dumper $error; }
Net::APNs::Extended is client library for APNs. The client is support the extended format.
Create a new instance of Net::APNs::Extended.
Net::APNs::Extended
Supported arguments are:
Default: 1
Required.
Sets certificate. You can not specify both cert and cert_file.
cert
cert_file
Sets private key. You can not specify both key and key_file.
key
key_file
Sets private key password.
Sets read timeout.
Send notification for APNs.
$apns->send($device_token, { apns => { alert => "Hello, APNs!", badge => 1, sound => "default", }, foo => [qw/bar baz/], });
Send notification for each data. The data chunk is same as send() arguments.
send()
Gets error data from APNs. If there is no error will not return anything.
if (my $error = $apns->retrive_error) { die Dumper $error; }
xaicron <xaicron {at} cpan.org>
Copyright 2012 - xaicron
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::APNs::Extended, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::APNs::Extended
CPAN shell
perl -MCPAN -e shell install Net::APNs::Extended
For more information on module installation, please visit the detailed CPAN module installation guide.