Open joshua-redmond opened 7 months ago
Hi @joshua-redmond , first of all thank you for trying out my library!
You can get the firebase admin config from this page:
https://console.firebase.google.com/u/0/project/your_project_name/settings/serviceaccounts/adminsdk
I'll post an update once I try onesignal + aracna/fcm, lmk if you manage to get the send message working in the example :D
@alchemicas I can confirm the send-message script works as expected after adding the service account JSON. The notification data is received.
That means it's only a problem when sending notifications using OneSignal.
Thank you @joshua-redmond , will test it against OneSignal this week!
Hello @joshua-redmond , I gave it a try today, but I honestly have no idea how to make it work, no matter what I put inside the notification I create on OneSignal, the raw_data that the FCM client receives is always the same bytes.
I tried to investigate and look at OneSignal's SDKs code, but I couldn't make much sense of it in the time I was looking. My theory is that they just don't put the payload of the notification inside the FCM send API, and they use their own API to deal with the notification data. But it's still just a theory since I wasn't able to confirm it by looking at their code.
So by using OneSignal you're basically to square one since they do not have a Node.js client for receiving notification, but just for creating them.
If you can find an answer or a hint I'd be eager to help and make this work somehow, but if we have to call OneSignal APIs then it's going to be out of scope for this library.
I won't investigate any further, but you or anyone else who's interested in this is welcome to help!
Hi, good to hear from you again.
That's... unfortunate :disappointed:
I can't think of a way around it either.
Thanks for your time investigating this issue :+1:
Hi!
How do I get the message's heading and body once it's received?
I'm sending messages using OneSignal (read more about my setup here).
This is what I get from
FcmClient
'smessage
event:This is what I get from the
message-data
event:How do I get the message's heading and body from this result?
Here's my code, based on the node example kindly provided in the repo:
I also tried using the node example in it's entirety, though ran into this error when running
npm run send-message
:The
npm start
gave me a token as expected, so who knows what went wrong.BTW, thanks for all your hard work creating this package! I really tried to wrap my head around FCM's new HTTP v1 API but gave up haha, I'm glad you understand it :laughing: