Open Macario opened 6 years ago
Hi Macario,
It seems that there are an error with the token are you sure that you provide a token to your request ?
Best Regards
well, i have same problem too, in my local it's working well, but if i tried in production server, i got an error like @Macario
anyway @brozot this is my code :
$notificationBuilder = new PayloadNotificationBuilder('Welcome');
$notificationBuilder->setBody('Hello world')
->setSound('default');
$notification = $notificationBuilder->build();
$topic = new Topics();
$topic->topic('testing');
$topicResponse = FCM::sendToTopic($topic, null, $notification, null);
$topicResponse->isSuccess();
$topicResponse->shouldRetry();
$topicResponse->error();
and i also inserted my firebase sender id and server key in my .env
how to fixed this case ?
well, i have same problem too, in my local it's working well, but if i tried in production server, i got an error like @Macario
anyway @brozot this is my code :
$notificationBuilder = new PayloadNotificationBuilder('Welcome'); $notificationBuilder->setBody('Hello world') ->setSound('default'); $notification = $notificationBuilder->build(); $topic = new Topics(); $topic->topic('testing'); $topicResponse = FCM::sendToTopic($topic, null, $notification, null); $topicResponse->isSuccess(); $topicResponse->shouldRetry(); $topicResponse->error();
and i also inserted my firebase sender id and server key in my .env
how to fixed this case ?
You should verify if there are tokens or if topic is not null, that worked for me!
Hello, sometimes my server got a error when it's sending message. Log below.
` production.ERROR: LaravelFCM\Response\Exceptions\InvalidRequestException: to in /home/producao/syncappapi/vendor/brozot/laravel-fcm/src/Response/BaseResponse.php:54 Stack trace:
0 /home/producao/syncappapi/vendor/brozot/laravel-fcm/src/Response/BaseResponse.php(32): LaravelFCM\Response\BaseResponse->isJsonResponse(Object(GuzzleHttp\Psr7\Response))
1 /home/producao/syncappapi/vendor/brozot/laravel-fcm/src/Response/DownstreamResponse.php(106): LaravelFCM\Response\BaseResponse->__construct(Object(GuzzleHttp\Psr7\Response))
2 /home/producao/syncappapi/vendor/brozot/laravel-fcm/src/Sender/FCMSender.php(57): LaravelFCM\Response\DownstreamResponse->__construct(Object(GuzzleHttp\Psr7\Response), Array)
3 /home/producao/syncappapi/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(221): LaravelFCM\Sender\FCMSender->sendTo(Array, NULL, Object(LaravelFCM\Message\PayloadNotification))
4 /home/producao/syncappapi/app/MessagePayload.php(32): Illuminate\Support\Facades\Facade::__callStatic('sendTo', Array)
5 /home/producao/syncappapi/app/Http/Controllers/EventController.php(374): App\MessagePayload->sendMessage('Sa\xC3\xADda', 'Andre Gurgel sa...', Array)
`