<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
canerdogan / laravel-notification-channel-fcm example snippets
classAccountActivatedextendsNotification{
publicfunctionvia($notifiable){
return [FcmChannel::class];
}
publicfunctiontoFcm($notifiable){
// The FcmNotification holds the notification parameters
$fcmNotification = FcmNotification::create()
->setTitle('Your account has been activated')
->setBody('Thank you for activating your account.');
// The FcmMessage contains other options for the notificationreturn FcmMessage::create()
->setPriority(FcmMessage::PRIORITY_HIGH)
->setTimeToLive(86400)
->setFcmKey('xxxx') // (Optional) Use this to override the FCM key from broadcasting.php
->setNotification($fcmNotification);
}
}
setFcmKey(string $fcmKey)
setCondition(string $condition)
setCollapseKey(string $collapseKey)
setContentAvailable(bool $contentAvailable)
setMutableContent(bool $mutableContent)
setPriority(string $priority)
setTimeToLive($timeToLive)
setDryRun(bool $dryRun)
setData(string $data)
setNotification(FcmNotification $notification)
setTitle(string $title)
setBody(string $body)
setClickAction(string $clickAction)
setAndroidChannelId(string $androidChannelId)
setIcon(string $icon)
setBadge(string $badge)
setSound(string $sound)
setTag(string $tag)
setColor(string $color)
setBodyLocKey(string $bodyLocKey)
setBodyLocArgs(array $bodyLocArgs)
setTitleLocKey(string $titleLocKey)
setTitleLocArgs(array $titleLocArgs)
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.