Reputation: 137
I created an events app using Firebase as database , which contains all the events occurring in my college , every event in database has a date child with it.
I'm unable to figure out how can I send notifications to every user about the event occurring on that date (for ex: suppose there is an event about vr on 12th April then i want users to receive notification on that day saying that you have so and so event in your college today )
I know there is FCM, but I don't want to manually send notifications everyday to hundreds of users.
I'd really appreciate if someone could help me out here.
Upvotes: 0
Views: 1693
Reputation: 317437
You have some options for scheduling a function to run periodically. This sample code goes over some options for creating an HTTPS endpoint that's pinged periodically by another service that you configure.
You can also schedule functions via pubsub as described in this blog.
Please also file a feature request for things you would like to see supported directly.
Upvotes: 1
Reputation: 10205
Cloud functions will not work for you without a server, since all the listeners they have are based in database, sign up or authentication events.
The solution is to add to your app Cloud Messaging support and create a server in Java or in Node that from X minutes to X minutes checks the list of events and send a notification to the users that are subscribing them.
Upvotes: 0