Giter VIP home page Giter VIP logo

net-apns-extended's Introduction

Build Status

NAME

Net::APNs::Extended - Client library for APNs that support the extended format.

SYNOPSIS

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->retrieve_error) {
    die Dumper $error;
}

DESCRIPTION

Net::APNs::Extended is client library for APNs. The client is support the extended format.

METHODS

new(%args)

Create a new instance of Net::APNs::Extended.

Supported arguments are:

  • is_sandbox : Bool

    Default: 1

  • cert_file : Str

  • cert : Str

    Required.

    Sets certificate. You can not specify both cert and cert_file.

  • key_file : Str

  • key : Str

    Sets private key. You can not specify both key and key_file.

  • password : Str

    Sets private key password.

  • read_timeout : Num

    Sets read timeout.

  • write_timeout : Num

    Sets write timeout.

$apns->send($device_token, $payload [, $extra ])

Send notification for APNs.

$apns->send($device_token, {
    apns => {
        alert => "Hello, APNs!",
        badge => 1,
        sound => "default",
    },
    foo => [qw/bar baz/],
});

$apns->send_multi([ [ $device_token, $payload [, $extra ] ], [ ... ] ... ])

Send notification for each data. The data chunk is same as send() arguments.

$apns->retrieve_error()

Gets error data from APNs. If there is no error will not return anything.

if (my $error = $apns->retrieve_error) {
    die Dumper $error;
}

AUTHOR

xaicron <xaicron {@} cpan.org>

COPYRIGHT

Copyright 2012 - xaicron

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

net-apns-extended's People

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.