-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
notification not sending to devices using in laravel using fcm by laravel-notification-channels/fcm #216
Comments
If you can provide a reproduction in a Laravel app I can look into this further but otherwise I can't do much here. |
how i can do so? |
Provide a fresh Laravel app that demonstrates the bug so I can pull it down and see the issue first hand. If I can't replicate the bug I can't help fix it. |
bro should i give you the repo link? in which im using this? https://github.com/sameededitz/drivewise i cant understand? |
can i contact u any other platform? so we can chat easily? |
Thanks - it looks like the issue only occurs with Anonymous notifiables as you're using here. It stems from this line in
Generally this will call the I think the fix for your use case is to update your routing to use foreach ($chunks as $chunk) {
NotificationFacade::route('fcm', $chunk)
->notify(new SendNotification('hello', 'world'));
} I'm not sure if there is a more conventional way for us to deal with this on the package side. However, this means your notification will be receiving tokens (where previously it was always getting an empty array). |
im using it to send notifications to all my devices
im not linking it to any user bc i want to send notification to all devices
i have a table and model named
DeviceToken.php that stores all the devicetokens/fcm_tokens of devices
DeviceToken.php Model
now i have notification table and i want that whenever a new notification is created then that notification is sent to all devices not to any specific users/devices that have my app installed
so i did this
SendNotification.php Notification Class
and thats my observer below which is called whenever a new notification record is created in db
NotificationObserver.php
in logs i see this
no error seems here but not a single device recieve notification
also i tried doing this
and it returns null and nothing more
please help me im stuck with it
The text was updated successfully, but these errors were encountered: