-
Notifications
You must be signed in to change notification settings - Fork 409
Class 'App\Http\Controllers\DownstreamResponse' not found #6
Comments
Hi Can you give me more informations about this error. Thanks |
$downstreamResponse = FCM::sendTo($tokens, $option, $notification); $downstreamResponse->numberSuccess(); //return Array - you must remove all this tokens in your database //return Array (key : oldToken, value : new token - you must change the token in your database ) //return Array - you should try to resend the message to the tokens in the array // return Array (key:token, value:errror) - in production you should remove from your database the tokens present in this array |
I commented out those lines apart from the first one and it worked. |
I am unable to reproduce your problem Do you use Laravel or Lumen? |
This is related to not having the The readme is missing them in some of the other examples, I only updated one. |
I am using Laravel 5.2 Notifications are sent but it produce errors on my laravel.log and I found these lines of codes are the ones causing it:
This was the error: [2016-07-22 09:10:28] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'App\Api\V1\Controllers\DownstreamResponse' not found' in C:\wamp\www\MyApp\app\Api\V1\Controllers\PushNotificationController.php:42 After I did what @gcphost recommended (use LaravelFCM\Response\DownstreamResponse;), I got the following error: [2016-07-22 09:11:39] local.ERROR: exception 'ErrorException' with message 'Undefined variable: response' in C:\wamp\www\MyApp\app\Api\V1\Controllers\PushNotificationController.php:42 Sorry, what does those lines of code do, I mean what are their functions. |
Hi, I think that your error is thrown by the following line:
You shouldn't instantiate DownstreamResponse is constructed by the package and is returned by the method: Like in the following line:
In summary,
Please can you give me a feedback if this solution is working for you. Best Regards |
Thanks for the detailed explanation, it works well now. Thanks |
Trying to send a Notification and I got the above error, how do I fix this?
The text was updated successfully, but these errors were encountered: