2017 © Pedro Peláez
 

library easyapns

Easy APNS for Laravel. Easy APNS is an Apple Push Notification Service using PHP & MySQL

image

keithslater/easyapns

Easy APNS for Laravel. Easy APNS is an Apple Push Notification Service using PHP & MySQL

  • Sunday, May 25, 2014
  • by keithslater
  • Repository
  • 3 Watchers
  • 7 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

A Laravel package of Easy APNS, (*1)

  • This is a very early beta. Use at your own risk. Please report any bugs *, (*2)

  • Author: Keith Slater, (*3)

  • Website: http://www.keithslater.com

Code ported from Easy APNS, (*4)

Installation Instructions

Add the following to your composer.json file, (*5)

"keithslater/easyapns": "dev-master"

Then run composer update, (*6)

After the project is updated, add the following to your app.php file:, (*7)

'providers' => array(
    'Keithslater\Easyapns\EasyapnsServiceProvider',
);

The following command runs the migration to your database, (*8)

$ php artisan migrate --package="keithslater/easyapns"

This command copies the config file to app/config/packages/keithslater/easyapns/config.php, (*9)

$ php artisan config:publish keithslater/easyapns

Upload your development and production .pem files to app/config/packages/keithslater/easyapns/. If you need to convert your certificates to pem certificate files, I recommend following this answer on Stackoverflow., (*10)

Modify app/config/packages/keithslater/easyapns/config.php as needed, (*11)

APNS command

Finds messages in the database that are still queued and will push them. Sends only first message for device, (*12)

$ php artisan apns fetch

Similar to fetch but sends all messages for each device, (*13)

$ php artisan apns flush

You might want to set one of these commands as a cronjob, (*14)

Usage

Add the following to the header where you are calling APNS, (*15)

use \Keithslater\Easyapns\Easyapns;

Then you will be able to use Easy APNS like normal:, (*16)

$apns = new Easyapns();
$apns->newMessage(1);
$apns->addMessageAlert('Test message sent');
$apns->queueMessage();
$apns->processQueue();

Refer to Easy APNS for more information., (*17)

Responding to the Apple Delegate methods

I recommend setting up a route named something similar to apns. From that route call Easyapns with all input requests. Something similar to this example:, (*18)

Route::get('apns', function() {
        $apns = new Easyapns(Input::all());
});

These few lines of code will respond to the delegate method from your app and add the new device to the database. Just change the host and urlString strings in the app delegate methods to point here., (*19)

The Versions

25/05 2014

dev-master

9999999-dev

Easy APNS for Laravel. Easy APNS is an Apple Push Notification Service using PHP & MySQL

  Sources   Download

The Requires

 

by Keith Slater

laravel apple ios push apns iphone push notifications ipad easyapns easy apns