2017 © Pedro Peláez
 

library php-apns

Object Oriented PHP Apple Push Notification Integration Library

image

jwage/php-apns

Object Oriented PHP Apple Push Notification Integration Library

  • Saturday, March 5, 2016
  • by jwage
  • Repository
  • 12 Watchers
  • 98 Stars
  • 54,210 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 27 Forks
  • 3 Open issues
  • 5 Versions
  • 15 % Grown

The README.md

PHP APNS

PHP Apple Push Notification Service Library, (*1)

Build Status Scrutinizer Quality Score Code Coverage Latest Stable Version Total Downloads Dependency Status, (*2)

Install

Install PHP APNS using composer:, (*3)

composer require jwage/php-apns

Generate Safari Notification Package

use JWage\APNS\Certificate;
use JWage\APNS\Safari\PackageGenerator;

$certificate = new Certificate(file_get_contents('apns.p12'), 'certpassword');
$packageGenerator = new PackageGenerator(
    $certificate, '/base/pushPackage/path', 'yourdomain.com'
);

// returns JWage\APNS\Safari\Package instance
$package = $packageGenerator->createPushPackageForUser('userid');

// send zip file to the browser
echo $package->getZipPath();

Sending Notifications

use JWage\APNS\Certificate;
use JWage\APNS\Client;
use JWage\APNS\Sender;
use JWage\APNS\SocketClient;

$certificate = new Certificate(file_get_contents('apns.pem'));
$socketClient = new SocketClient($certificate, 'gateway.push.apple.com', 2195);
$client = new Client($socketClient);
$sender = new Sender($client);

$sender->send('devicetoken', 'Title of push', 'Body of push', 'http://deeplink.com');

The Versions

05/03 2016

dev-master

9999999-dev http://github.com/jwage/php-apns

Object Oriented PHP Apple Push Notification Integration Library

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-openssl *
  • ext-zip *

 

apple apns notifications

07/01 2014

v0.0.3

0.0.3.0 http://github.com/jwage/php-apns

Object Oriented PHP Apple Push Notification Integration Library

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-openssl *
  • ext-zip *

 

apple apns notifications

07/01 2014

dev-fix/connect-exception

dev-fix/connect-exception http://github.com/jwage/php-apns

Object Oriented PHP Apple Push Notification Integration Library

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-openssl *
  • ext-zip *

 

apple apns notifications

26/12 2013

v0.0.2

0.0.2.0 http://github.com/jwage/php-apns

Object Oriented PHP Apple Push Notification Integration Library

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-openssl *
  • ext-zip *

 

apple apns notifications

10/12 2013

v0.0.1

0.0.1.0 http://github.com/jwage/php-apns

Object Oriented PHP Apple Push Notification Integration Library

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-openssl *
  • ext-zip *

 

apple apns notifications