Reputation: 1630
I have an iOS app that uses Firebase database to store users and events. Each event has a start date that is an NSDate in my app but gets converted to a string and stored in Firebase. When the data is retrieved from Firebase the date string is converted back into NSDate in my app.
I would like to send push notifications to any users that are attending an event 1 hour before the event. Would Firebase Cloud Messaging be the solution for this? I'm not sure how to do it since the start date is just a string in Firebase ("Sat, Jun 11, 2016, 9:30 AM EDT") so I'm not sure how Firebase could read this and generate the notification based off of the string. Thank you for any suggestions!
Upvotes: 1
Views: 248
Reputation: 344
You can create your own Server with scripts that will be run to send your notifications based on your own database instead of using Firebase database. This way you can use datetime field to store your dates and comparing them.
This may require a lot more work but this surely will benefit you in future because you can maintain it easily.
You can refer to their documentation on how to create Server-side API.
Upvotes: 0
Reputation: 141
Firebase doesn't currently have any integration between the database and Notifications, so you'd need to create the Notifications message manually.
Upvotes: 0