NAME
    Mojo::APNS - Apple Push Notification Service for Mojolicious

VERSION
    0.01

DESCRIPTION
    This module provides an API for sending messages to an iPhone using
    Apple Push Notification Service.

    This module does not support password protected SSL keys.

SYNOPSIS
      use Mojo::APNS;

      my $apns = Mojo::APNS->new(
                  key => '/path/to/apns-dev-key.pem',
                  cert => '/path/to/apns-dev-cert.pem',
                  sandbox => 1,
                );

      $apns->on(drain => sub { $apns->loop->stop; })
      $apns->send(
        "c9d4a07c fbbc21d6 ef87a47d 53e16983 1096a5d5 faa15b75 56f59ddd a715dff4",
        "New cool stuff!",
        badge => 2,
      );

      $apns->ioloop->start;

EVENTS
  error
    Emitted when an error occur between client and server. This event will
    also get "Timeout" events.

    Internal errors:

    *   Too long message ($length)

        This is emitted if the total payload (not just the message) is
        longer than 256 characters.

  drain
    Emitted once all messages have been sent to the server.

ATTRIBUTES
  cert
    Path to apple SSL certificate.

  key
    Path to apple SSL key.

  sandbox
    Booleand true for talking with "gateway.sandbox.push.apple.com". Default
    is to use "gateway.push.apple.com"

  ioloop
    Holds a Mojo::IOLoop object.

METHODS
  send
      $self->send($device, $message, %args);

    Will send a $message to the $device. %args is optional, but can contain:

    *   badge

        The number placed on the app icon. Default is 0.

    *   sound

        Default is "default".

    *   Custom arguments

AUTHOR
    Jan Henning Thorsen - "jhthorsen@cpan.org"

