Best way to send notifications on react native expo - firebase

I doing a application with react native, expo and firebase.
I want to send notifications on my device but I would like to know the best way to do it.
I got the expo token and device token , so I can send notifications on the ‘https://exp.host/--/api/v2/push/send' url .
I could do a firebase cloud function that send to this url the notifications.
But I would like to know if we have another way to do it ?
I can do a function that listen to change on the realtime database with the « on » function to make notifications.
Or use some socketIo with firebase function ?
Or maybe use the device token ?
I don’t like to use a lots of external service, if I could use the firebase cloud message it would be good.
If you guys have some tips or advice.
Thanks for all help.

Related

Device-to-device messages with FCM and XMPP

I'm setting up a React Native app to, essentially, send messages between devices (it's not a chat app in practice but technically that's what it's doing). I've decided to use Firebase and the RN Firebase library to manage this.
I've finally got my iPhone receiving notifications from the Firebase notification composer. But it's saying I need an XMPP server in order to send messages from devices.
I do see the example in the RN Firebase docs but I'm hoping to do this app severless, just using Firebase for messaging, db, what have you.
I'm going through docs on Firebase (searching their site for XMPP) but it's not quickly clear, so I'm posting here to see if anyone can point me to instructions to quickly set this up in Firebase itself without running my own server (or that someone would know whether it's possible).

Firebase Cloud Messages Push Notifications

I have developed a simple android app using Firebase database to store stuff.
Now, I want to set up notifications for each time a button is clicked.
Each time the button is clicked, it will take some info from firebase (text mostly) and will send a notification to anyone who downloaded the app.
I understood that simply creating a notificationManager won't work as needed.
I also heard about Firebase Cloud Messaging but im pretty new to this so I must know what I should start learning to make that work out.
So, if you have any good tutorials or anything helpful, that would be great!
Thanks!
You need to receive for the FCM in android app. Refer this doc. And you need to can use database triggers in firebase cloud functions to send FCM notification, or you need to deploy a cloud http function to do so.

Firebase Messaging in Flutter Upstream messages

I'm trying to configure Firebase Messaging in Flutter, but it seems that there is no implementation yet for the Upstream messages.
https://firebase.google.com/docs/cloud-messaging/android/upstream
What I want to do is to add a reminder and notify the user after x time with a push notification.
Let me know if you guys have any other solution, or we should simply wait for Flutter and Firebase for Flutter to became stable.
Thanks
Alvin
You are correct that there is no implementation for upstream messaging in FlutterFire yet, we are working on filling out these features. However given your use case you may be able to do something like write the user's reminder to Firestore or Firebase Realtime Database then when you are ready to send push notifications you can use Cloud Functions for Firebase to send the messages to the required devices.

Firebase FCM - React Native

Well, I'm new to React Native and Firebase and I have some questions about it. If somebody could help me I would appreciate it!
How react-native-fcm is related to Firebase Notifications Console? Is there a configuration on fcm when implementing that refers to that "notification database"?
On react-native-fcm documentation there's an example that uses:
FCM.subscribeToTopic('/topics/foo-bar');
Is that a reference to Firebase or something? Or it's just a silly question?
There's any way to send a notification when a child is added to Firebase Database?
Thank you!
react-native-fcm I think is a React library to use FCM. Firebase Notifications Console is a part of the Firebase Console where you're able to send push notifications towards your app without the use of your own App Server.
It's a function for sendig messages to Topics.
There is. The recently released Cloud Functions for Firebase sounds like what you're looking for. Specifically, Realtime Database Triggers. :)

push notifications ionic 2 for android

I need to configure push notifications for an Ionic 2 application for android devices.
I read here that in order to do that you need to login to Firebase console, create a project and so on...
So my question is, do I really need to log into Firebase to do this? I'm not using firebase in my app, so I don´t get why I need to create a project to get a SERVER_ID and SERVER_KEY. What if I delete that project in Firebase afterwards, then my push notifications will stop working?
Thanks
Yes, you do need an account to use Firebase Cloud Messaging because you'll need a key to send pushs.
You need the key to use device-to-device push via HTTP and you need a project to send notifications to a group or topics.
I don't think that there's a way to use push without creating an account in any service.
You don't need a Firebase account.
You can use azure notifications hub or amazon aws or google cloud service, ionic cloud, etc.
Any cloud services that provides a notification hub which is basically a server for receiving and redistributing to the registered parties to the specific platforms.
Please note that some of these are specifically mobile oriented meaning you wont have to write any server side code and others aren't.

Resources