Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Firebase Cloud Functions are still in their Beta phase but I still think its the best Feature of Firebase, making any things easier for developers. In one of my previous blog, I presented a method to send notification message to a Firebase Notification key if there is a new message for that user. Now I am here to provide you a way to send messages to multiple notification keys or tokens whenever there is a new message for that person or group, whatever the case is for you.
For that firstly lets see our database structure first. So this is the database structure. There are two main sub-sections namely data and messages. The data part contains customer data while the message part contains the messages exchanged between people.As we can not enter single token values under tokens filed because its a json-based database, I used the one defined in Firebase sample i.e. to use token value as key and giving value true against the json value. You can provide any other value if you want.
So now lets move on to writing the event function. So all the process is same just we need a iterator to iterate through all the values in tokens so we are using method Promise.all() The final method I got is as
And here you got to send message to multiple tokens whenever a new message is added to the particular sender node.
Source: https://github.com/firebase/functions-samples/tree/master/fcm-notifications
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
It was a successful collaboration. The Mobikul team provided the client everything they needed in a timely and high-quality manner. They were very professional, reliable, and accessible during the entire process. The client also saw no room for any improvements in the vendor's performance.
Vincenzo Carrano
Administrator, Segshop
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.