Icemix Firebase Cloud Messages Notification Driver
icemix/laravel-fcm-notification-channel is a Laravel package for icemix firebase cloud messages notification driver.
It currently has 1 GitHub stars and 33 downloads on Packagist (latest version V1.2).
Install it with composer require icemix/laravel-fcm-notification-channel.
Discover more Laravel packages by icemix
or browse all Laravel packages to compare alternatives.
Last updated
This package makes it easy to send notifications using Firebase Cloud Messaging (FCM) with Laravel 5.3. This package is based on brozot/laravel-fcm, so please read that documentation for more information.
You can install this package via composer:
composer require icemix/laravel-fcm-notification-channel:1.0
Register the provider directly in your app configuration file config/app.php:
'providers' => [
// ...
NotificationChannels\FCM\ServiceProvider::class
]
Now you can use the channel in your via() method inside the notification:
use NotificationChannels\FCM\FCMMessage;
use Illuminate\Notifications\Notification;
class ExampleNotification extends Notification
{
public function via($notifiable)
{
return ['fcm'];
}
public function toFCM($notifiable)
{
return (new FCMMessage())
->notification([
'title' => 'Notification title',
'body' => 'Notification body',
]);
}
}
FCMMessage: Send notifications to device(s).FCMMessageTopic: Send notifications to topic(s).FCMMessageGroup: Send notifications to group(s).In order for your notice to know who to send messages, you must add routeNotificationForFCM method to your notification model.
data(): Notification data. array | LaravelFCM\Message\PayloadData | LaravelFCM\Message\PayloadDataBuilderoptions(): Notification options. array | LaravelFCM\Message\Options | LaravelFCM\Message\OptionsBuildernotification(): Notification content. array | LaravelFCM\Message\PayloadNotification | LaravelFCM\Message\PayloadNotificationBuildersetDryRunsetPrioritysetTimeToLivesetCollapseKeysetDelayWhileIdlesetMutableContentsetContentAvailablesetRestrictedPackageNameisDryRungetPrioritygetTimeToLivegetCollapseKeyisDelayWhileIdleisMutableContentisContentAvailablegetRestrictedPackageNamesetTagsetBodysetIconsetTitlesetSoundsetBadgesetColorsetChannelIdsetClickActionsetBodyLocationKeysetBodyLocationArgssetTitleLocationKeysetTitleLocationArgsgetTaggetBodygetIcongetTitlegetSoundgetBadgegetColorgetChannelIdgetClickActiongetBodyLocationKeygetBodyLocationArgsgetTitleLocationKeygetTitleLocationArgs$ composer test
Having trouble? Open an issue!
The MIT License (MIT). Please see License File for more information.