I have two news application one for news reader for reading news and another for posting news to firebase database for specific user. Now, I want to send notification to news reader when a new post is posted to firebase database. Is it possible to send notification added a new post into database from android device? I don't want to use any 3rd party server for sending notification or send notification from firebase console. I actually want send notification automatically to every readers when a new post is posted from and android user...
Asked
Active
Viewed 38 times
0
-
It's possible, but it's not advisable. Being able to send the push from the client side would mean that you would have the credentials (e.g. Server Key) on a client app, which could expose it to unwanted/unauthorized users if they ever get the app. (see my answer [here](https://stackoverflow.com/a/42966198/4625829)) with your use-case, you could just make use of the [Database Triggers](https://firebase.google.com/docs/functions/database-events) of ***Cloud Functions for Firebase*** – AL. Jul 03 '17 at 08:28
-
So what is the solution for this situation and suggest me a complete tutorial link. – MD Ashikur Rahman Jul 03 '17 at 10:09
-
Asking for a complete solution isn't how Stack Overflow works and asking for tutorial links are *off-topic* as well. Read over the docs I linked and I'm pretty sure you'd figure it out. Good luck. – AL. Jul 03 '17 at 10:13
-
See [this blog post](https://firebase.googleblog.com/2016/08/sending-notifications-between-android.html), [this sample](https://firebase.google.com/docs/functions/use-cases#notify_users_when_something_interesting_happens), and [this answer](https://stackoverflow.com/questions/37990140/how-to-send-one-to-one-message-using-firebase-messaging/37993724#37993724). – Frank van Puffelen Jul 03 '17 at 14:59