How to create a Firebase Cloud Messaging Notification - javascript

I have an Capacitor.js app and it uses the Firebase Cloud Messaging SDK for Push Notifications via the Push Notification Plugin. I also have a Discord bot (this is less relevant) and I want to, when a user sends a message, it will send that data to the Firebase and then that will create a notification so that the Capacitor.js app will have a notification with said data.
But I am new to Firebase and I have been reading their documentation and it is quite difficult to 1). Navigate and 2). they don't have any useful code snippets I can look at to learn how it works. Maybe that's just a problem I have, idk.
I'm wanting it for Node.js. And I really have no idea what I am doing. I have installed the Firebase Node.js package and that's about all.

Related

Can we retrieve messages from amazon connect platform through sdk or any other means?

I'm building a chatbot on my end and want to maintain a customer-agent chat flow where customer will be on my platform and agent will be on the amazon connect platform. Thus, I would like to retrieve messages from amazon connect platform as well. I have checked the docs and some sdks but nothing seems to help.
I have used GetTranscript sdk, it is providing me a transcript of the session, including details about any attachments, but there is no triggering event where I can get the latest messages not all the messages and also automatically not where I need to call this sdk in order to retrieve the messages. I have also looked for webhooks, checked web sockets, explored its lambda function but nothing seems to be helpful.
Please let me know if there is any further details required from my end.

Creating webapp with Node.js and Firebase/Firestore

I've built an iOS/firestore app. I'm now looking to create a web app to integrate with my database. I was going through the documentation and found a distinction between firebase for Node.js (https://firebase.google.com/docs/web/setup) and firebase firebase admin SDK (https://firebase.google.com/docs/admin/setup).
I believe that I will want admin privileges and control over the web app but since I'm learning this for the first time should I focus on the basics of getting user auth, access to the database, storage and cloud functions working? Or will be changing/adding the admin privileges down the line be such a hassle that it's better to struggle through it now?
I'm still new to the web side of firebase and I'm trying to get a feel for the approach I should take.
If you're building a web interface for your app, I'd encourage you to use the Firebase JS SDK and do most of the work client-side. It should be pretty similar to what you've already done in iOS.
You should only use the Admin SDK if you're specifically trying to create endpoints with custom trusted functionality that isn't available by using the normal SDKs.

Can I host a Facebook Chatbot on Firebase?

I created a chatbot to work with my fanpage on Facebook. This was done with a node.js base. When I do a 'firebase init', I get a /public folder and lots of other stuff. I do 'firebase deploy', but my bot is never called. Is there a way for work this out?
I have this as a reference:
Hosting nodeJS app with firebase
Still I got some faith this is a different case. Thanks in advance!
Well, I believe I got the answer now. Firebase only supports hosting for frontend stuff. For a chatbot I'd use something like NodeJS, PHP or other backend tecnologies. Thus, Heroku is a good call.
You should be able to Cloud Functions for Firebase to write a chat bot - I believe you might need to use a paid plan because the free tier does not allow Functions to make outbound calls.
I found a gist that appears to be an actual Facebook chat bot using functions:
https://gist.github.com/mikkipastel/37fa011e3aea7ebb9941fb3dab6f1186

Firebase 2 (firebase.google.com) Push Notification - manage from outside

I cant find any information about managing push notification outside the firebase.google.com GUI.
We need to send pushes dynamically, therefore we need to create script, which allows us to do this. For example right now, we are using Parse, we download Parse SDK to our server, give it keys etc., and then we can send pushes dynamically.
Is there any possibility for doing this with new Firebase SDK?
Firebase does not provide a REST API for their Notifications product. You'll have to use low-level Firebase Cloud Messaging (FCM) HTTP API with topics or push tokens directly, it's very similar to Google Cloud Messaging.
There is no way to trigger push notifications to specific users (Firebase UID), or to target properties & events like you would do with the web dashboard. You should consider 3rd party services like Parse Server, Batch.com etc. if you are looking for a higher level API, open-rate analytics etc.
There was little confusion, but as mentioned by Gerrit Hoekstra, the notifications are handled by Firebase Cloud Messaging (I do not know, why they have no reference from Notification topic to make it clear).
There is no SDK, however the REST API seems quite simple, you also have possibility to implement your own XMPP server for it.

Is there any way to create channels in Parse.com via REST API?

I'm working in a Ionic App to report potholes in the city. The user can make reports through the App or the Webpage, then other users can comment this issue and receive notifications about this specific topic.
I read the documentation for Parse.com of how to send push notifications for specific channels, for example, each report is a different channel. So if I comment in the report 123214 so automatically I will subscribe to this channel in Parse.com and receive notifications. Already know how to do this.
But Is there any way of create these channels in the same time that I generate the report in the App using javascript and REST API request ?
best regards

Categories