I am creating an android game where the user should be able to see other users that are currently online when answering questions and should be able to interact with them - ask questions and chat basically. No state will be saved after the user has interacted with other users - that part of the app does not save chat history nor does it save users online. I was looking at ejabberd and open fire or do i go with GCM?
Google Cloud Messaging, now rebranded on it's newer version, Firebase Cloud Messaging -- is a service commonly and mainly used for push notifications. I don't see how you could use this to build a Presence System, so no.
You might want to look into Firebase Realtime Database, specially this Firebase Blog on creating a Presence System with it.
Related
There is a free app available on Google's play store which sends push notifications to your phone when certain events occur ("news" events). I would like to be able to somehow store/scrape these notifications and eventually save them onto the Google Cloud platform.
The closest thing I have done to this is writing a python web scraper but I have never done anything with mobile apps and have no idea if this is even possible.
I tried googling but I only get results about sending push notifications to apps you have written yourself using Firebase. Any help/pointers in the right direction would be appreciated.
As far as I am aware, the only way to directly integrate Android App Notifications with Google Cloud Platform is through Firebase Cloud Messaging [1]. However the flow is in the opposite direction (from GCP to Android), and some dependencies need to be present in the Android App folders (like google-services.json file of the Cloud Project needs to be present in the App folder). For that to happen, you need to have ownership of the app.
You can use Google Cloud Storage on Android [2] to transfer the notification data / payload, but still you need to have an app for that.
[1] https://firebase.google.com/docs/cloud-messaging
[2] https://firebase.google.com/docs/storage/android/start
Hello everybody I am making a real time chat app based on flutter. I am using Firebase as backend of my app and the sample texting is working awesome. But I want to add an active feature for the chat, like when user is active, on the app for the other user he had an early conversation with him, he is showing that he is currently active, and a green light shows up like in messenger or viber or what app. Can I do it with flutter and firebase?
What you're describing is what's known as a presence system, which can be implemented on Firebase's Realtime Database by combining its .info/connected node and its onDisconnect handlers. For full details see the Firebase documentation on managing presence. The link is for Android, but the same functionality is available in the Flutter library.
If you're using Cloud Firestore, such functionality isn't available directly in the product, but you can integrate Realtime Database and Firestore to build a presence system.
Have 2 apps on separate devices: Rider & Driver.
Let's say, the Driver needs to contact the Rider via messaging, or vice versa, is there a way to do it without using the stocked message app to protect privacy?
My idea was to create on both apps an empty box, add a text view for the message and send button and add the msgs to firebase db. Unfortunately, i am not sure how i would do it in Android as well as the response.
Any suggestions or how to's would be greatly appreciated.
You could probably integrate your app with Firebase.
For simple messaging, you could use Firebase Cloud Firestore to do it and for notification, you can use Firebase Cloud Messaging.
Messaging
You can have a sub-collection to store all the chats between the rider and driver in the form of documents. 1 chat will be a document storing the info such as time, sender, as well as message.
Notification
From the doc:
Send acknowledgments, chats, and other messages from devices back to
your server over FCM’s reliable and battery-efficient connection
channel.
You could start research from Firebase sample application.
Highly recommend you go through this third party tutorial: Firebase Tutorial: Real-time Chat to get some idea, it's in iOS but the concept is the same.
Yes, there is a way to do it.
Actually you can use any messaging platform, e.g. Firebase, ConnectyCube, Twillio, Layer etc.
All of them provide API & SDK for iOS, Android and Web for chat so you can easily do it using it.
I used ConnectyCube some time ago, it can be done in the following way:
Initialize app
Sign Up user
Connect to chat
Create a chat dialog with other user
Send/Receive messages
More detailed chat code sample for Android can be found here
Most of the above platforms provide a cloud hosted plan, but some of them also provide an Enterprise plan when you the whole platform can be installed at your AWS/Google/Azure account, so hence the privacy is the best because you own all your data
I designed movie program that let user to select specific movies to let him follow any new news about it. For any important article i notify my user using firebase notification but how to make it automation to notify any one of them about any specific movie or category ?
according to my googling i can do that using google app engine but i am not sure !
There are multiple routes to go about what you are looking for. All of them will require you to set up a server, either on app engine or something similar, that continuously updates your database with new information. I would not rely on just data change events on your database in your app to do notifications though. I would look into Firebase Cloud Functions as well as Firebase Cloud Messaging where you wait for something in the database to change with a function, which then pushes the notifications with cloud messaging.
The Firebase Console allows us to send notifications to single users, groups, users subscribed to topics or to the entire user base. Is there any code that allows us to directly send notifications in the same way, but programmatically?
For example, if I had a list of users (containing their Firebase UIDs), if I click on one of the users, could I send a notification to that user through Firebase the same way the console allows us to send a notification through the console?
This Firebase Blog uses the Google App Engine Flexible Environment to actually send the notifications, but it requires a free trial and costs money.
This Quickstart doesn't really show how to send user to user notifications. It focuses on the subscription-based notifications, but this isn't really what I need.
Is there any good way of doing this with Java/Kotlin and the Firebase API?
FCM doesn't support you sending message directly from Android app to Android app. However, this is a workaround to solve your problem:
Create a firebase cloud function. Listen a special path in firebase database
Android app 1 push a data (maybe Android app 2 ID) to this path
Firebase cloud function process data, determine who to send notification (Android app 2).
Firebase cloud function push notification to Android app 2.
ref: https://firebase.google.com/docs/functions/use-cases#notify_users_when_something_interesting_happens
In a basic concept: we write our server to get action from firebase database and decision to send notification to other user by FCM. This our server can write with NodeJS or using Firebase Cloud Function (above)
Guide how to using Nodejs is here: https://firebase.googleblog.com/2016/08/sending-notifications-between-android.html