APNS::Agent - agent server for APNS
use APNS::Agent; my $agent = APNS::Agent->new( certificate => '/path/to/certificate', private_key => '/path/to/private_key', ); $agent->run;
APNS::Agent is agent server for APNS. It is also backend class of apns-agent.
This module provides consistent connection to APNS and cares reconnection. It utilizes AnyEvent::APNS internally.
THE SOFTWARE IS ALPHA QUALITY. API MAY CHANGE WITHOUT NOTICE.
APNS::Agent launches HTTP Server process which accepts only POST method and application/x-www-form-urlencoded format parameters.
application/x-www-form-urlencoded
Acceptable parameters as follows:
token
device token by HEX format. (Required)
payload
JSON string for push notification. If you only want to send message, alternatively can use alert parameter.
alert
One of payload and alert must be supplied. Both of payload and alert are specified, the payload parameter has priority.
push notification message.
AnyEvent::APNS
Thank @shin1rosei that many code of this module is taken from https://github.com/shin1rosei/AnyEvent-APNS-Server.
Copyright (C) Songmu.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Songmu <y.songmu@gmail.com>
To install APNS::Agent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm APNS::Agent
CPAN shell
perl -MCPAN -e shell install APNS::Agent
For more information on module installation, please visit the detailed CPAN module installation guide.