0

What I'm developing right now is a simple voting app. One user can ask a question from a group of people (who have subscribed to him). And that group of people can reply him with their answer.

Firebase was my first choice since it offers a database, authentication and push notifications.

I'm confused since I'm not sure how to implement the above use case out of the features Firebase provides.

What are my options?

KENdi
  • 7,576
  • 2
  • 16
  • 31
lxkmxl
  • 81
  • 1
  • 7
  • 1
    To send notification to many device you need Firebase Token of every device(To which you want to send notification) to send notification.If you want help in code then feel free to ask. – Rishabh Mahatha May 03 '17 at 10:03
  • It is possible to get the tokens during authentication and save it to the database. I'm assuming once I have the tokens, I could iterate through them send a notification to each? – lxkmxl May 03 '17 at 11:00
  • 1
    yes it is possible you can get the token,but keep one thing in mind each and every time you login from different device the device token is get refreshed so you have to update the refreshed token in your database, Cause this token is depends on device. – Rishabh Mahatha May 03 '17 at 11:02
  • in my case, i don't have to consider single person logging in using multiple devices. so i assume the above approach would be sufficient. – lxkmxl May 03 '17 at 11:05
  • Yes it is sufficient ,But as a developer we have to take care of all these things. – Rishabh Mahatha May 03 '17 at 11:07

1 Answers1

0

the best option is to use Topics, firebase gives you the possibility to send multiple notification to users subscripted to that topic, check this link

Oussema Aroua
  • 5,225
  • 1
  • 24
  • 44
  • I did look in to topics as well but this http://stackoverflow.com/a/37376040/2866067 points out that topics take time appear on the console. But does it affect the functionality? – lxkmxl May 03 '17 at 10:58
  • @lxkmxl - It doesn't affect the functionality. It only takes time to appear in the console, but as soon as the topic is created, you can use it immediately. – AL. May 04 '17 at 03:01