t::TLS;
require bytes;
use Carp qw(croak);
use Encode;
use Scalar::Util 'looks_like_number';
use JSON::Any;
our $VERSION = '0.10';
has certificate => (
is => 'rw',
isa => 'Str |
clearer => 'clear_handler',
);
has json_driver => (
is => 'rw',
isa => 'Object',
lazy => 1,
default => sub {
JSON::Any->new( utf8 => 1 );
},
);
has on_
sub send {
my $self = shift;
my ($token, $payload, $expiry) = @_;
my $json = encode_utf8( $self->json_driver->encode($payload) );
# http://developer.apple.com/library/ios/#DOCUMENT