2017 © Pedro Peláez
 

library apns-http2

image

nfilin/apns-http2

  • Wednesday, November 30, 2016
  • by nfilin
  • Repository
  • 6 Watchers
  • 13 Stars
  • 541 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 3 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

apns-http2

Requires Curl with HTTP2 and SSL support., (*1)

Usage example:, (*2)

<?php
    use Nfilin\Libs\ApnsHttp2 as Apns;

    /* Create APNS certificate */
    $certificate = new Apns\Certificate('/path/to/certificate', 'pass_phrase');

    /* Create connection */
    $connection = new Apns\Connection($certificate, [ 'sandbox' => false  ]);

    /* Create payload */
    $payload = new Apns\Payload();
    $payload->title = 'Alert title';
    $payload->custom_data['some_custom_data_key'] = 'some data';
    $payload->badge = 1;

    /* Wrap list of receivers to recognizable format */
    $receivers = new Apns\DeviceList(
                [
                    'notification_id_of_first_receiver',
                    'notification_id_of_second_receiver',
                    //...
                ]
            );

    /* Create message for seklected receivers and payload */
    $message = new Apns\Message($receivers, $payload);

    /* Sign message with topic valid for selected receivers */
    $message->topic = 'some.example.app';

    /* Set expire time in seconds from current time */
    $message->time_to_live = 3600; // One hour after been sent

    /* Send notifications and get responses */
    $response = $connection->send($message);

The Versions

30/11 2016

dev-master

9999999-dev https://github.com/nfilin/apns-http2

  Sources   Download

MIT

The Requires

 

by Stanislav Markovskyi

17/03 2016

v1.0.1

1.0.1.0 https://github.com/nfilin/apns-http2

  Sources   Download

MIT

The Requires

 

by Stanislav Markovskyi

16/03 2016

v1.0.0

1.0.0.0 https://github.com/nfilin/apns-http2

  Sources   Download

MIT

The Requires

 

by Stanislav Markovskyi