laravel-notification-channels / fcm

Firebase Cloud Messaging (FCM) notifications channel for Laravel
https://laravel-notification-channels.com/
MIT License
495 stars 127 forks source link

Requested entity was not found. #22

Closed dilipdk closed 4 years ago

dilipdk commented 4 years ago

I have done everything fine. its worked two days before. i don't know why its not working now. its saying an error from "vendor/laravel-notification-channels/fcm/src/Exceptions/CouldNotSendNotification.php". and the error is Requested entity was not found.

dilipdk commented 4 years ago

please help me to resolve it

chrisbjr commented 4 years ago

Hi @dilipdk what version are you using?

First of all, please try updating to the latest version 2.0.2. There is a fix there that could be the reason for your problem.

If not, there would only be 2 instances where you would encounter the CouldNotSendNotification exception.

See here: https://github.com/laravel-notification-channels/fcm/blob/master/src/FcmChannel.php

First is when your notification's toFcm() does not return an instance of FcmMessage. Maybe you could check if it does return that kind of object.

Second is when the FCM message could not be sent due to HTTP exceptions. In this case, you might want to log the response that was thrown and check.

Hope this helps.

gopalkriagg commented 4 years ago

One reason I can think of is this: https://stackoverflow.com/a/56218146/3563059 That is the token no longer is associated with any user. Maybe the user uninstalled the app. In this case I think the only option remaining is to delete the token from the database.