Push Notification With Laravel 4

By: Ryan Wong at

To Implement Push notification do the following:
add “davibennun/laravel-push-notification”: “dev-master” to your composer.json file

1
2
3
composer update davibennun/laravel-push-notification

php artisan config:publish davibennun/laravel-push-notification

Add the following to “app/config/app.php”

1
2
3
4
5
6
7
'providers' => array(
Davibennun\LaravelPushNotification\LaravelPushNotificationServiceProvider
)

'aliases' => array(
'PushNotification' => 'Davibennun\LaravelPushNotification\Facades\PushNotification'
)

Run the following:

1
php artisan config:publish davibennun/laravel-push-notification

Fill in your api key and you can now use your push notification for android.

##Common errors I recieved

  1. {“multicast_id”:XXXXXXXXXXXXXXXX,”success”:0,”failure”:1,”canonical_ids”:0,”results”:[{“error”:”MismatchSenderId”}]}
    Reason for this is becuase the sender id on the device is not a match to the api key on the server. The device Id is generated each time
    you register the push notification.