user15226396
user15226396

Reputation: 109

Sending push notification to stored Realtime database

I would like to send notifications to another device number after completion of certain process by current device. e.g. If A user completes the operation then B will get notification.

I am maintaing Realtime database by having all mobile numbers with unique ids.like below:

        rootNode = FirebaseDatabase.getInstance();
        reference = rootNode.getReference("Logins");
        String id = reference.push().getKey();
        reference.child(id).setValue(mobile);

and data is:

cofy-ac782-default-rtdb
    ->Logins
      -> -M_1PKZ6x-mLQQ22zoFM: "888886666699"
      -> -M_1PeRIIsM3QGuwmelW: "888886666790"

Above two are two users having these mobiles. So, I would like to send notifiction from first user to second.

I am bit confused, if i would be able to use this data for notification using Cloud messaging. Is it possible that i refer this database and send generate push notifications?

Help is appreciated.

Regards, PD

Upvotes: 0

Views: 359

Answers (1)

Harsh Suvagiya
Harsh Suvagiya

Reputation: 106

You must refer to firebase functions that will help you to send notification to specific person when UserA complete some task and your realtime database gets update at that moment firebase functions will do the rest.

For Firebase functions you must have little knowledge of Node.Js.

Refer to this link.

Upvotes: 1

Related Questions