belbase/push-notification

This is the The Library of Push Notification for Firebase.

1.0.x-dev 2018-08-24 06:30 UTC

This package is not auto-updated.

Last update: 2024-04-28 03:30:53 UTC


README

Build Status
The Laravel 5 Package for Push Notification. Currently supported Services: Firebase Cloud Messaging

Installation

Step 1: Install package using composer

    composer require belbase/push-notification

Step 2: Add the service provider to the config/app.php file in Laravel (Optional for Laravel 5.5)

    Belbase\PushNotification\Providers\PushNotificationServiceProvider::class,

Step 3: Add an alias for the Facade to the config/app.php file in Laravel (Optional for Laravel 5.5)

    'PushNotification' => Belbase\PushNotification\Facades\PushNotification::class,

Step 4: Publish the config by running in your terminal

    php artisan vendor:publish

Usage

Edit the config/pushnotification.php. Set the appropriate Service and its parameters. Then in your code...
use PushNotification;

Initiate Request and Redirect using the default service:-

      /* All Required Parameters by your Service */
      $deviceAccessToken = 'DEVICE-ACCESS-TOKEN-HERE';
      $metaData=[
        // enter data to send along with notification
      ];
      return PushNotification::to($deviceAccessToken)->setMessage('title','body',$metaData)->sendMessage();

Contributors

  1. Deepak Belbase
  2. Deepak Gupta

License

The PushNotification is open-sourced software licensed under the MIT license.