enniel / laravel-fcm-notification-channel Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hello,
im trying get the downstreamresponse just in case some of the tokens need updating. I can't figure it out on how to get it, is there a way ?
Hello,
"Notification was not sent. You should specify device token(s), topic(s) or group(s) for sending notification."
However, laravel-fcm.log
logs
[2017-05-13 20:37:29] Laravel-FCM.INFO: notification send to 1 devices success: 1 failures: 0 number of modified token : 0 [] []
and the push notification was successfully delivered.
When used with Laravel 5.8 an exception is thrown: Illuminate\Events\Dispatcher::fire()
From the upgrade docs:
The fire method (which was deprecated in Laravel 5.4) of the Illuminate/
Events/Dispatcher class has been removed
<laravel/framework#26392>. You should use the
dispatch method instead.
I tried installing the package, but I got the following error
- Installation request for enniel/laravel-fcm-notification-channel 1.*@dev -> satisfiable by enniel/laravel-fcm-notification-channel[1.0.x-dev].
- enniel/laravel-fcm-notification-channel 1.0.x-dev requires brozot/laravel-fcm dev-master -> satisfiable by brozot/laravel-fcm[dev-master] but these conflict with your requirements or minimum-stability.
PHP Error: Class 'LaravelFCM/Message/OptionsPriorities' not found in vendor/enniel/laravel-fcm-notification-channel/src/FCMMessage.php on line 285
I have various notifications that get sent to users via a number of channels depending on how they registered. It can be APN, FCM or email. Not all notifications will be sent via all channels and when no FCM user can be found, routeNotificationForFCM returns an empty array.
The APN and Email channels handle this fine; if there are no recipients (empty array), the notification is not sent via these channels.
This FCM library, however, throws an exception when that occurs, while it is a perfectly viable flow.
For comparison, here is the APN channel source;
$tokens = (array) $notifiable->routeNotificationFor('apn');
if (! $tokens) {
return;
}
$message = $notification->toApn($notifiable);
if (! $message) {
return;
}
... [actual sending] ...
vs the FCM source
$message = $notification->toFCM($notifiable);
if ($message->recipientNotGiven()) {
if (! $to = $notifiable->routeNotificationFor('FCM')) {
throw CouldNotSendNotification::missingRecipient();
}
$message->to($to);
}
... [actual sending] ...
Could this please be resolved to behave like the other notification channels out there?
I have no problem sending message to single device with user token, but now i need to send notification to a topic what should i do?
This is my code
use NotificationChannels\FCM\FCMMessageTopic;
.....
public function toFCM($notifiable)
{
return (new FCMMessageTopic())
->to($this->topic)
->notification([
'title' => 'Notification title',
'body' => 'Notification body',
]);
}
and it return this error
FatalThrowableError in FirebaseNotification.php line 43:
Call to undefined method NotificationChannels\FCM\Exceptions\InvalidArgumentException::notification()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.