2017 © Pedro Peláez
 

library phpush

Send push notifications to iOS and Android by PHP

image

abraovic/phpush

Send push notifications to iOS and Android by PHP

  • Wednesday, June 13, 2018
  • by abraovic
  • Repository
  • 1 Watchers
  • 0 Stars
  • 85 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

abraovic/phpush

Installation

The preferred method of installation is via Packagist and Composer. Run the following command to install the package and add it as a requirement to your project's composer.json:, (*1)

composer require abraovic/phpush

Examples

You can find more examples under examples section of this lib, (*2)

<?php
require 'vendor/autoload.php';

use abraovic\PHPush;
use abraovic\PHPush\Exception\PHPushException;

try {

    $type = PHPush\Push\Push::IOS;
    $credentials = [
        'device_token' => 'fake-token', // for multiple use an array 'device_token' => ['fake-token-1', 'fake-token-2', ...]
        'certificate_path' => 'fake-cert',
        'certificate_phrase' => '',
        'dev' => true
    ];

    // enable printing payload before send (for development purpose)
    PHPush\Push\Push::$printPayload = true;

    $push = new PHPush\Push\Push($type, $credentials);
    $message = new PHPush\Push\Message($type, "Hello");
    $message->setBadge(200);
    $message->setBody('body');
    $iosMsg = $message->getMessage();
    $iosMsg->setSound('default');

    if ($push->sendMessage($message)) {
        echo "sent";
    }
} catch (PHPushException $e) {
    echo 'Caught exception: ' . $e->getMessage() . "\n";
}

Contributing

Contributions are welcome! Please read CONTRIBUTING for details., (*3)

The abraovic/phpush library is copyright © Ante Braovic and licensed for use under the Apache2 License., (*4)

The Versions

13/06 2018

dev-refactoring

dev-refactoring https://github.com/abraovic/PHPush

Send push notifications to iOS and Android by PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

push apns fcm

31/07 2017

dev-master

9999999-dev https://github.com/abraovic/PHPush

Send push notifications to iOS and Android by PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

push gcm apns fcm

28/04 2016

v0.2.1

0.2.1.0 https://github.com/abraovic/PHPush

Send push notifications to iOS and Android by PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

push gcm apns

01/02 2016

v0.2.0

0.2.0.0 https://github.com/abraovic/PHPush

Send push notifications to iOS and Android by PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

push gcm apns

29/01 2016

v0.1.1

0.1.1.0 https://github.com/abraovic/PHPush

Send push notifications to iOS and Android by PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

push gcm apns

29/01 2016

v0.1.0

0.1.0.0 https://github.com/abraovic/PHPush

Send push notifications to iOS and Android by PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

push gcm apns