-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrating FCM or PubSub Push #51
Comments
I'm still trying to figure this out, I really don't want to redo all my code in the JavaScript. There's gotta be a way to send Firebase Cloud Messaging from here, that's my whole purpose of needing to run a Firebase Functions server to send notifications. Any ideas? |
It does seem like messaging is missing from the admin class here |
I'm not sure I understand the problem here. Do you have a cloud function which should send a PubSub message? If you're using Of course, it would be nice to add FCM support to |
Yeah, that's what I'm waiting for myself |
I had hoped the native dart plugins would have been compatible, but I'm realizing the interop trick having to translate to node.js calls.. It would be nice if it was a builtin function for sure. I don't know if pubsub is easier to impliment or Cloud Messaging, I could go with either for pushing notification to a channel group or individual Firebase UIDs. Whatever's easier to hack together, it's that missing piece to get my app functional. If I can help, lemme know, but this part of code gets daunting... Thanks. |
Did anyone here manage to send a push message from dart in a Firebase function? I really hope I do not have to redo all my code using Javascript. |
I'm facing problems using the Dart fcm_push or the pubsub push in gcloud. I installed the gcloud, googleapis and googleapis_auth dependencies, and set up the ServiceAccountCredentials to get the AuthClient, and everything seems to be done right, however I get this uncaught exception in the log:
ReferenceError: XMLHttpRequest is not defined
at /user_code/build/node/main.dart.js:9351:7
I just can't get past that, no matter what I tried. Is there a trick I'm missing, or a better way to push notifications to subscribers or user token ids using this interop? Here is my pubsub.yaml:
and my relevant imports:
and my code to init the client:
Everything builds/deploys correctly, except in the log with the client auth, or try to do a cloudMessaging.send() I get that pesky XMLHttpRequest is not defined error that I can't find anything about fixing. Has anyone else been able to send push notifications from their Firebase Functions trigger? Seems like it would be a common use case, any help would be appreciated, thanks..
The text was updated successfully, but these errors were encountered: