Replies: 1 comment 7 replies
-
This looks like a registration token that has either been unregistered or is not registered to the same Firebase project as the Admin SDK. The official docs go into more details why a token can be unregistered: https://firebase.google.com/docs/cloud-messaging/http-server-ref?hl=en#error-codes PS: Please use Markdown formatting for code/error Blocks, they make them much easier to read 😅 |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I got this error, It worked before. I have been getting this error since about February 1, 2021.
Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error:
POST https://fcm.googleapis.com/v1/projects/veganesingles/messages:send
resulted in a404 Not Found
response: (truncated...) in D:\wwwroot\veganesingles\www\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113 Stack trace: #0 D:\wwwroot\veganesingles\www\vendor\guzzlehttp\guzzle\src\Middleware.php(69): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response), NULL, Array, NULL) #1 D:\wwwroot\veganesingles\www\vendor\guzzlehttp\promises\src\Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response)) #2 D:\wwwroot\veganesingles\www\vendor\guzzlehttp\promises\src\Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL) #3 D:\wwwroot\veganesingles\www\vendor\guzzlehttp\promises\src\TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}() #4 D:\wwwroot\veganesingles\www\vendor\guzzleh in D:\wwwroot\veganesingles\www\vendor\kreait\firebase-php\src\Firebase\Exception\Messaging\NotFound.php on line 22My Code:
`<?php
/**
31.01.2021
wird includiert von inc/function/message.php
*/
// for standalone testing
require_once("../../inc/conf.php");
//require '../vendor/autoload.php';
require "$rootpath/www/vendor/autoload.php";
use Kreait\Firebase\Factory;
use Kreait\Firebase\Messaging\CloudMessage;
use Kreait\Firebase\Messaging\Message;
$factory = (new Factory())
->withServiceAccount("$rootpath/firebase/firebase_credentials.json")
->withDatabaseUri('https://veganesingles-default-rtdb.firebaseio.com')
;
$messaging = $factory->createMessaging();
// for testing
if(!$deviceToken) {
$deviceToken = "123";
$title = "veganesingles";
$body = "Test Nachricht...";
}
$notification = [
"body" => $body,
"title" => $title
];
$data = [
"type" => "Nachricht",
"site" => "tablinks/message"
];
//echo $deviceToken;
//print_r($notification);
$message = CloudMessage::withTarget('token', $deviceToken)
->withNotification($notification) // optional
//->withData($data) // optional
;
$messaging->send($message);
?>
`
Beta Was this translation helpful? Give feedback.
All reactions