Hola comunidad de Stackoverflow, he estado mirando varias secciones de la misma pregunta pero no he encontrado una buena respuesta, entonces decidí formular la mía con mi respecto problema, mi problema es la siguiente, he creado una app que recibe notificaciones mediante un apartado web escrito en el lenguaje PHP, la app está conectada a Firebase y hecha en Android Studio, a continuación les proporciono el apartado PHP:
<?php
$titulo = $_GET['titulo'];
$mensaje = $_GET['mensaje'];
////////ENVÍO DE NOTIFICACIÓN/////////
$fcmUrl = 'https://fcm.googleapis.com/fcm/send';
$token = 'acá está el token';
$apiKey = 'acá está el api cloud key';
$notification = ['title' => $titulo, 'body' => $mensaje, 'icon' => 'myIcon', 'sound' => 'mySound'];
$extraNotificationData = ["message" => $notification, "moredata" => 'dd'];
$fcmNotification = [
'to' => $token,
'notification' => $notification, 'data' => $extraNotificationData];
$headers = ['Authorization: key=' . $apiKey, 'Content-Type: application/json'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $fcmUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fcmNotification));
$result = curl_exec($ch);
curl_close($ch);
echo $result;
?>
<!DOCTYPE html>
<html>
<head>
<title>Enviar Notificación</title>
</head>
<body>
<form action="generar_notificacion" method="GET">
<input type="text" name="titulo">
<input type="text" name="mensaje">
<input type="submit" value="Enviar">
</form>
</body>
</html>
Es un apartado muy simple ya que es de prueba, mi intención inicial es hacer la prueba a un dispositivo en concreto y luego a todos los dispositivos que luego tendré que averiguar por que no tengo idea de como hacerlo, siguiendo con la pregunta, cuando abro la web, sin siquiera hacer el envío me sale el siguiente error:
ERROR: {"multicast_id":17618352122632735,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"MismatchSenderId"}]}
También cuando lo envío aparece el mismo error y no sé a que se debe, la app está formulada correctamente, me tomé la molestia de revisar antes de publicar la pregunta, agradecería mucho si pudieran ayudarme a encontrar la solución, gracias de ante mano