I initialize Web firebase and I get Token:
I get current token after it is created and I send it in simple message:
curl -X POST -H "Authorization: key=AAAA_XXXMYKEYXXXw26gv" -H "Content-Type: application/json" -d '{
"to" : "fo3aexgjsbQ:APA91bEWh47m2cVoflhQ_E__E31jbQpoyaHZTRKmkJIG7Uaarrw0KwvCYYCnNTMmaQIcKBFrq2fGFEBj-nVB9obE-wf4FiTCKedR_gWdMPfc8bNgpK5MQ7SsLmcVRWLlert3AXXdbuzk",
"data" : {
"body" : "This is an FCM notification message!",
"title" : "FCM Message",
}
}' "http://ift.tt/1TmHkUo"
I get the following success result:
{"multicast_id":8683406144829883570,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1512147661586241%2fd9afcdf9fd7ecd"}]}
The problem is that nothing is displayed or printed in the console! I am sending request, I see success and... nothing happend both when website is opened and when it is closed!
Here is my firebase-messaging-sw.js file placed in root directory:
I also tried to set configuration this way:
firebase.initializeApp({
'messagingSenderId': '1091715558873'
});
I specified manifest:
Aucun commentaire:
Enregistrer un commentaire