All Projects → multicaret → laravel-firebase

multicaret / laravel-firebase

Licence: MIT license
Laravel FCM (Firebase Cloud Messaging) Notification Channel

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-firebase

laravel-firebase
Laravel Firebase API implementation
Stars: ✭ 22 (-12%)
Mutual labels:  fcm, fcm-notifications, laravel-firebase
Electron Push Receiver
A module to bring Web Push support to Electron allowing it to receive notifications from Firebase Cloud Messaging (FCM).
Stars: ✭ 158 (+532%)
Mutual labels:  notifications, fcm, firebase-cloud-messaging
Push Receiver
A library to subscribe to GCM/FCM and receive notifications within a node process.
Stars: ✭ 125 (+400%)
Mutual labels:  notifications, fcm, firebase-cloud-messaging
andpush
Android Push Notification in Ruby: The fastest client for FCM (Firebase Cloud Messaging)
Stars: ✭ 83 (+232%)
Mutual labels:  notifications, fcm, firebase-cloud-messaging
fcmpush
Firebase Cloud Messaging API wrapper for Ruby, suppot HTTP v1 API including access_token auto refresh feature.
Stars: ✭ 44 (+76%)
Mutual labels:  fcm, firebase-cloud-messaging, fcm-notifications
PUSHTestFCM
[FireMonkey] Push test project
Stars: ✭ 17 (-32%)
Mutual labels:  notifications, fcm, fcm-notifications
Rpush
The push notification service for Ruby.
Stars: ✭ 1,886 (+7444%)
Mutual labels:  notifications, fcm, firebase-cloud-messaging
Applozic Android Sdk
Android Real Time Chat & Messaging SDK
Stars: ✭ 611 (+2344%)
Mutual labels:  notifications, fcm, firebase-cloud-messaging
FCM-OnDeviceNotificationScheduler
Demo implementation to Schedule FCM Notifications on Android Device using AlarmManager + WorkManager.
Stars: ✭ 111 (+344%)
Mutual labels:  fcm, firebase-cloud-messaging, fcm-notifications
FCMBundle
A Bundle for Symfony projects to send notifications in mobile devices through Firebase Cloud Messaging API
Stars: ✭ 43 (+72%)
Mutual labels:  notifications, fcm, firebase-cloud-messaging
Facebook
📨 Facebook Notifications Channel for Laravel
Stars: ✭ 120 (+380%)
Mutual labels:  notifications, laravel-5-package
Net Core Push Notifications
Lightweight .NET Core Push Notifications for Android and iOS
Stars: ✭ 105 (+320%)
Mutual labels:  notifications, fcm
Node Gcm
A NodeJS wrapper library port to send data to Android devices via Google Cloud Messaging
Stars: ✭ 1,286 (+5044%)
Mutual labels:  notifications, firebase-cloud-messaging
Notifier
NO LIBRARIES socket per page bridge for your Laravel application. (CLIENT PART INCLUDED)
Stars: ✭ 57 (+128%)
Mutual labels:  notifications, laravel-5-package
Laravel Fcm
Firebase Cloud Messaging (FCM) sender for Laravel
Stars: ✭ 129 (+416%)
Mutual labels:  notifications, fcm
Laravel Messenger
Notifying your users doesn't have to be a lot of work.
Stars: ✭ 135 (+440%)
Mutual labels:  notifications, laravel-5-package
Onesignal Gradle Plugin
Use with OneSignal-Android-SDK to help integrate it into your Android Studio or Gradle project. https://onesignal.com
Stars: ✭ 49 (+96%)
Mutual labels:  notifications, fcm
React Native Fcm
react native module for firebase cloud messaging and local notification
Stars: ✭ 1,729 (+6816%)
Mutual labels:  notifications, fcm
fcm
Golang client library for Firebase Cloud Messaging.
Stars: ✭ 22 (-12%)
Mutual labels:  fcm, firebase-cloud-messaging
Easynotifylibproject
Send firebase notifications to your users very easily: A new Android Lib
Stars: ✭ 31 (+24%)
Mutual labels:  notifications, fcm

laravel-firebase

This package makes it easy to send notifications using Firebase Cloud Messaging (FCM) with Laravel Notification Channel.

Installation

This package can be installed through Composer.

composer require liliom/laravel-firebase

If you don't use Laravel 5.5+ you have to add the service provider manually

// config/app.php
'providers' => [
    ...
    Liliom\Firebase\FirebaseServiceProvider::class,
    ...
];

Now add you Firebase API Key in config/services.php.

return [
	....
    'firebase' => [
        'key' => ''
    ],
    ....
];

Usage

Les's create a notification using artisan commend:

php artisan make:notification FirebaseNotification

Now you can use firebase channel in your vie() mothod.

public function via($notifiable)
{
    return ['firebase'];
}

Add a pubilc method toFirebase($notifiable) to your notification class, and return an instance of FirebaseMessage:

public function toFirebase($notifiable)
{
    return (new \Liliom\Firebase\FirebaseMessage)
        ->notification([
            'title' => 'Notification title',
            'body' => 'Notification body',
            'sound' => '', // Optional
	    'icon' => '', // Optional
	    'click_action' => '' // Optional
        ])
        ->setData([
	    'param' => 'zxy' // Optional
	])
	->setPriority('high'); // Default is 'normal'
}

Available methods:

  • setData: To Set data.
  • setPriority: To Set priority.
  • setTimeToLive: To Set time_to_live.
  • setCollapseKey: To Set collapse_key.
  • setNotification: To Set notification.
  • setCondition: To Set condition.
  • setContentAvailable: To Set content_available.
  • setMutableContent: To Set mutable_content.
  • setPackageName: To Set restricted_package_name.

When sending to specific device(s), make sure your notifiable entity has routeNotificationForFirebase method defined:

Note: You can send to many devices by return an array of tokens.

/**
 * Route notifications for Firebase channel.
 *
 * @return string|array
 */
public function routeNotificationForFirebase()
{
    return $this->device_tokens;
}

License

The MIT License (MIT). Please see License File for more information.

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].