Reputation: 1694
I want to use FCM and I'm not sure which option would apply best to my situation. Essentially I have artists in a database that users can follow, so for each artist I have a variable number of users that follow it.
Now if an artist releases something new, I want to send out a notification to all of the users that follow it. And here are my only options:
Issues I have with each of the options:
I'd usually go with the 1. option and I was wondering if it can be done with let's say 1000 Users (so essentially a for loop 1000 times and each creates a send promise).
Is there anything I'm missing to send notifications to a large group of users which each could have a large amount of groups / topics?
Thank you
Upvotes: 1
Views: 1480
Reputation: 598668
I'd definitely pick topics for your use-case, they're pretty much made for this. While option 1 would also be possible, it just feels senseless to manage the subscriptions yourself in this case.
If you want to allow someone to also subscribe to news about all artists, create a topic all
and then send news about any artist to a condition: ('The Beatles' in topics || 'all' in topics)
.
Upvotes: 1