2017 © Pedro Peláez
 

library laravel-push-notification

Laravel 5 Package for sending push notifications to Android and iOS devices

image

witty/laravel-push-notification

Laravel 5 Package for sending push notifications to Android and iOS devices

  • Wednesday, November 11, 2015
  • by larkinwhitaker
  • Repository
  • 4 Watchers
  • 26 Stars
  • 4,288 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 9 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

laravel-push-notification

Based off of https://github.com/davibennun/laravel-push-notification with support for Laravel 5 and 5.1., (*1)

Installation

Update your composer.json file to include this package as a dependency, (*2)

"witty/laravel-push-notification": "dev-master"

Register the PushNotification service provider by adding it to the providers array in the config/app.php file., (*3)

'providers' => array(
    'Witty\LaravelPushNotification\PushNotificationServiceProvider'
)

Alias the PushNotification facade by adding it to the aliases array in the config/app.php file., (*4)

'aliases' => array(
    'PushNotification'      => 'Witty\LaravelPushNotification\PushNotification',
)

Configuration

Copy the config file into your project by running, (*5)

php artisan vendor:publish

This will generate a config file like this, (*6)

array(
    'iOS'     => [
        'environment' => env('IOS_PUSH_ENV', 'development'),
        'certificate' => env('IOS_PUSH_CERT', __DIR__ . '/ios-push-notification-certificates/development/certificate.pem'),  
        'passPhrase'  => env('IOS_PUSH_PASSWORD', '291923Job'),
        'service'     => 'apns'
    ],

    'android' => [
        'environment' => env('ANDROID_PUSH_ENV', 'development'),
        'apiKey'      => env('ANDROID_PUSH_API_KEY', 'yourAPIKey'),
        'service'     => 'gcm'
    ]
);

Where all first level keys corresponds to an service configuration, each service has its own properties, android for instance have apiKey and IOS uses certificate and passPhrase. You can set as many services configurations as you want, one for each app. A directory with the name 'ios-push-notification-certificates' will be added to the config folder for you to store both development and production certificates., (*7)

Dont forget to set service key to identify iOS 'service'=>'apns' and Android 'service'=>'gcm'

Usage


PushNotification::app('iOS') ->to($deviceToken) ->send('Hello World, i`m a push message');

The Versions

11/11 2015

dev-master

9999999-dev

Laravel 5 Package for sending push notifications to Android and iOS devices

  Sources   Download

MIT

The Requires

 

by Larkin Whitaker

laravel laravel 5 notification push gcm apns

11/11 2015

1.0.0

1.0.0.0

Laravel 5 Package for sending push notifications to Android and iOS devices

  Sources   Download

MIT

The Requires

 

by Larkin Whitaker

laravel laravel 5 notification push gcm apns