itisnajim / strapi-plugin-fcm

Send FCM notifications from your Strapi app.
MIT License
22 stars 11 forks source link

Unable to send Push #21

Open boardmain opened 4 months ago

boardmain commented 4 months ago

i have several problem firebase push is working ( if i try to send from firebase ) and service account json is saved:

FCM auth not valid if i try to send push directly from to fcm notifications collection

{
  "code": "messaging/authentication-error",
  "message": "An error occurred when trying to authenticate to the FCM servers. Make sure the credential used to authenticate this SDK has the proper permissions. See https://firebase.google.com/docs/admin/setup for setup instructions. Raw server response: \"<HTML>\n<HEAD>\n<TITLE>PROJECT_NOT_PERMITTED</TITLE>\n</HEAD>\n<BODY BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\">\n<H1>PROJECT_NOT_PERMITTED</H1>\n<H2>Error 401</H2>\n</BODY>\n</HTML>\n\". Status code: 401."
}

and i. try to send a push from the ui i have this error:


Error

Failed to send to FCM. {"message":"Request failed with status code 500","name":"AxiosError","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{"FormData":null},"headers":{"Authorization":"Bearer #####","Accept":"application/json","Content-Type":"application/json"},"baseURL":"/strapi-plugin-fcm","url":"/fcm-notifications","method":"post","data":"{\"data\":[{\"title\":\"TEST\",\"body\":\"TEST TEST\",\"image\":\"\",\"payload\":\"\",\"targetType\":\"topics\",\"target\":\"push\"}]}"},"code":"ERR_BAD_RESPONSE","status":500}~~~
AlameenAzad commented 4 months ago

This should help you out: Link