All Projects → kawankoding → Laravel Fcm

kawankoding / Laravel Fcm

Firebase Cloud Messaging (FCM) sender for Laravel

Projects that are alternatives of or similar to Laravel Fcm

Push Fcm Plugin
Official Firebase Cloud Messaging plugin for Push.js v1.0 🔥
Stars: ✭ 37 (-71.32%)
Mutual labels:  firebase, notifications, fcm
Laravel Fcm
🌐 A Laravel package to send Push Notifications to one or many devices of the user.
Stars: ✭ 56 (-56.59%)
Mutual labels:  firebase, laravel, notifications
React Native Fcm
react native module for firebase cloud messaging and local notification
Stars: ✭ 1,729 (+1240.31%)
Mutual labels:  firebase, notifications, fcm
Fcm
Firebase Cloud Messaging (FCM) notifications channel for Laravel
Stars: ✭ 169 (+31.01%)
Mutual labels:  firebase, laravel, fcm
Laravel Notification
Example package for using the (still under development) Messages API from Nexmo as a notification channel in Laravel
Stars: ✭ 44 (-65.89%)
Mutual labels:  laravel, notifications
Builder
Prepare your Laravel apps incredibly fast, with various commands, services, facades and boilerplates.
Stars: ✭ 1,009 (+682.17%)
Mutual labels:  laravel, notifications
Onesignal Gradle Plugin
Use with OneSignal-Android-SDK to help integrate it into your Android Studio or Gradle project. https://onesignal.com
Stars: ✭ 49 (-62.02%)
Mutual labels:  notifications, fcm
Notifier
NO LIBRARIES socket per page bridge for your Laravel application. (CLIENT PART INCLUDED)
Stars: ✭ 57 (-55.81%)
Mutual labels:  laravel, notifications
Pushraven
A simple Java library to interface with Firebase Cloud Messaging (FCM) API. Pushraven allows you to push notifications to clients in very few lines of code.
Stars: ✭ 67 (-48.06%)
Mutual labels:  firebase, fcm
Laravel Console Logger
Logging and Notifications for Laravel Console Commands.
Stars: ✭ 79 (-38.76%)
Mutual labels:  laravel, notifications
Net Core Push Notifications
Lightweight .NET Core Push Notifications for Android and iOS
Stars: ✭ 105 (-18.6%)
Mutual labels:  notifications, fcm
Cordova Plugin Firebase
Cordova plugin for Google Firebase
Stars: ✭ 997 (+672.87%)
Mutual labels:  firebase, notifications
Nativescript Plugin Firebase
🔥 NativeScript plugin for Firebase
Stars: ✭ 990 (+667.44%)
Mutual labels:  firebase, fcm
Kotlin Firebase Group Chat
Group and OneonOne chat using firebase built in Kotlin similar to whatsapp.
Stars: ✭ 44 (-65.89%)
Mutual labels:  firebase, fcm
Project
⭐️ Antares Project Application Skeleton. This is the very first place you should start. It allows you to create a brand new awesome project in easy few steps.
Stars: ✭ 84 (-34.88%)
Mutual labels:  laravel, notifications
Laqul
A complete starter kit that allows you create amazing apps that look native thanks to the Quasar Framework. Powered by an API developed in Laravel Framework using the easy GraphQL queries language. And ready to use the Google Firebase features.
Stars: ✭ 110 (-14.73%)
Mutual labels:  firebase, laravel
Easynotifylibproject
Send firebase notifications to your users very easily: A new Android Lib
Stars: ✭ 31 (-75.97%)
Mutual labels:  notifications, fcm
Facebook
📨 Facebook Notifications Channel for Laravel
Stars: ✭ 120 (-6.98%)
Mutual labels:  laravel, notifications
Espionage
An android application that can be run in background and give commands from fcm console to share sensor data
Stars: ✭ 18 (-86.05%)
Mutual labels:  firebase, fcm
Laravel Smsgateway Notification Channel
SMS Gateway notification channel for Laravel
Stars: ✭ 13 (-89.92%)
Mutual labels:  laravel, notifications

Laravel FCM

A simple package that help you send a Firebase notification with your Laravel applications

Installation

You can pull the package via composer :

$ composer require kawankoding/laravel-fcm "^0.2.0"

Laravel

You must register the service provider :

// config/app.php

'Providers' => [
   // ...
   Kawankoding\Fcm\FcmServiceProvider::class,
]

If you want to make use of the facade you must install it as well :

// config/app.php

'aliases' => [
    // ...
    'Fcm' => Kawankoding\Fcm\FcmFacade::class,
];

Next, You must publish the config file to define your FCM server key :

php artisan vendor:publish --provider="Kawankoding\Fcm\FcmServiceProvider"

This is the contents of the published file :

return [

    /**
     * Set your FCM Server Key
     * Change to yours
     */

    'server_key' => env('FCM_SERVER_KEY', ''),

];

Lumen

Add the following service provider to the bootstrap/app.php file

$app->register(Kawankoding\Fcm\FcmServiceProvider::class);

Also copy the laravel-fcm.php config file to config/laravel-fcm.php

Add the configuration to the bootstrap/app.php file Important: this needs to be before the registration of the service provider

$app->configure('laravel-fcm');
...
$app->register(Kawankoding\Fcm\FcmServiceProvider::class);

Set your FCM Server Key in .env file :

APP_NAME="Laravel"
# ...
FCM_SERVER_KEY=putYourKeyHere

Usage

If You want to send a FCM with just notification parameter, this is an example of usage sending a FCM with only data parameter :

$recipients = [
    'clKMv.......',
    'GxQQW.......',
];

fcm()
    ->to($recipients)
    ->priority('high')
    ->timeToLive(0)
    ->data([
        'title' => 'Test FCM',
        'body' => 'This is a test of FCM',
    ])
    ->send();

If You want to send a FCM to topic, use method toTopic($topic) instead to() :

fcm()
    ->toTopic($topic) // $topic must an string (topic name)
    ->priority('normal')
    ->timeToLive(0)
    ->notification([
        'title' => 'Test FCM',
        'body' => 'This is a test of FCM',
    ])
    ->send();

If You want to send a FCM with just notification parameter, this is an example of usage sending a FCM with only notification parameter :

fcm()
    ->to($recipients) // $recipients must an array
    ->priority('high')
    ->timeToLive(0)
    ->notification([
        'title' => 'Test FCM',
        'body' => 'This is a test of FCM',
    ])
    ->send();

If You want to send a FCM with both data & notification parameter, this is an example of usage sending a FCM with both data & notification parameter :

fcm()
    ->to($recipients) // $recipients must an array
    ->priority('normal')
    ->timeToLive(0)
    ->data([
        'title' => 'Test FCM',
        'body' => 'This is a test of FCM',
    ])
    ->notification([
        'title' => 'Test FCM',
        'body' => 'This is a test of FCM',
    ])
    ->send();
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].