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.
Related
I want to implement functionality in the application on which user can schedule their exam on a particular date and time. and I want to generate notification before one day ago, so users will get reminded about their exam. I am using Firebase Database.Should i use Alarm Manager for that? or any background service ?
I don't have any idea about this. so can anyone help me how to implement this?
any help would be appreciated. Thank you.
One possibility would be to use Firebase Cloud Messaging (https://firebase.google.com/docs/cloud-messaging/) together with Cloud Functions.
You would write an HTTPS Cloud Function that would be triggered regularly (e.g. everyday in your case) and that checks, by querying the database, if there are some notifications to be sent, and if it is the case, sends them to the corresponding users.
You would trigger the HTTPS Cloud Function through an external service like https://cron-job.org/en/ or https://www.easycron.com/.
You will find an example of Cloud Function sending Firebase Cloud Messaging notifications in the official samples, here: https://github.com/firebase/functions-samples/tree/Node-8/fcm-notifications
In this sample, the Cloud Function is triggered by a Realtime Database event (see doc) but you can easily changed it to be triggered by an HTTP request (see doc), in order to trigger it with the cron online service.
If you are not familiar with Cloud Functions I would suggest that you watch the following official Video Series "Learning Cloud Functions for Firebase" (here in the doc), and in particular the three videos titled "Learn JavaScript Promises" which will show in details the difference between HTTPS triggered functions and Database events triggered ones.
The full doc for Cloud Functions for Firebase is here.
I'd like to make notifications with Firebase when the Firebase Database is modified. I guess this could make with Firebase functions and Firebase Cloud Messaging, but I don't know if this way is correct or not, please if someone can help me clarifying this doubt, below I explain that I want my application to do, thx!!
I want my app to send notifications all the users near the another user(1km for example) when this user publish an ad.
As fellow developers, I encourage you to boldly try whatever comes up in your mind!
But if I were you, I'd do the same thing. Firebase Functions allow you to have function trigger according to Firebase Realtime Database events. So you can use that, to trigger a specific function that will send a FCM Message.
In your Android App, make sure to implement FirebaseMessagingService (and set it up in your AndroidManifest.xml), and every time message is received (through FirebaseMessagingService.onMessageReceived), create new notification!
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.
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
We are implementing a mobile app which let users share to-do lists. The idea is to have as little server administration as possible and obviously keep cost down.
For user management and push notifications we will use Parse.com with Cloud Code and PubNub for real time data delivery.
Every user will log in with it facebook' s credentials and subscribe to a read only private channel that only him can read. Every time he create a new to-do list to share with his facebook's friends, the app will make an API call to CloudCode, with it's identity, the data to share and a list of friends. In CloudCode the data is pushed to the PubNub private channels of the list of friends.
In addition in CloudCode the idea is to use PubNub Presence and if the user is offline, send a Push notification.
Is this implementation ok? I'm new to both services and trying to learn. Thanks!
PubNub is appropriate if you are trying to implement a realtime app such as a chat application or a GPS tracking application. But in your case, I think you may not need PubNub's features at all. You can have the afore mentioned functionalities using Parse.com only. The parse push can be used in both the scenarios.
When the user is logged in, and is using the application :- Receive the push, suppress the notification and update the UI with the newly received data.
When the user is not online or logged in, then simply create a notification and add a click listener activity for it.
The reason why I suggest to remove PubNub (for this particular application) is that, PunNub has a different pricing model for loading history. On the free plan, you are limited to one day of message history. On the other hand, you can run this app's backend on Parse.com, almost free cost.
There's nothing in the architecture you describe above that Parse can't handle, including the ability to support Facebook login and external service calls via Cloud Codes Parse.Cloud.httpRequest(). It will do it and do it well thus the answer is yes, this is ok.
Go forth and Parse.