내 서버에 저장된 PHP 스크립트를 사용하여 알림을 보내려고하고 있는데 MismatchSenderId가 표시됩니다. I에 유래 여기에 모든 단일 질문을 확인했고 그것을 해결할 수 {"multicast_id":7804476702639319453,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"MismatchSenderId"}]}
firebase serverside로 MismatchSenderId 가져 오기
:
$to="device_id";
$title="MYAPP Push";
$message=" MYAPP Push Notification Message";
sendPush($to,$title,$message);
function sendPush($to,$title,$message){
// API access key from Google API's Console
// replace API
define("API_ACCESS_KEY", "server_key_provided_by_firebase");
$registrationIds = array($to);
$msg = array(
'message' => $message,
'title' => $title,
'vibrate' => 1,
'sound' => 1
// you can also add images, additionalData
);
$fields = array(
'registration_ids' => $registrationIds,
'data' => $msg
);
$headers = array(
'Authorization: key=' . API_ACCESS_KEY,
'Content-Type: application/json'
);
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');
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($fields));
$result = curl_exec($ch);
curl_close($ch);
echo $result;
}
여기에 내가 오류가 나는 PHP 스크립트를 실행할 때.
저는 firebase (스파크 플랜)을 사용하고 Phonegap으로 앱을 개발 중입니다. 나는 그 앱과 아무 상관이 없다고 믿는다.
어떤 아이디어 ???
안녕 @Bob. 그것은. google-services 파일은 프로젝트의 루트 폴더 (config.xml과 같은 위치)에 있습니다. 그것은 www 폴더에 배치해야합니까? 감사합니다. –
@RaffaeleColleo : 죄송합니다. 나는 코르도바 건축물에 익숙하지 않다. –
누구든지이 문제에 대해 저를 도울 수 있습니까? –