Service for sending SMS or Push Notification

I have an application developed in Angular 7 that is in the final stage of development. This application makes use of Firebase services, one of them is Cloud Firestore.

I'm looking for a way to have a service that runs daily without stopping, that identifies when to send an SMS alerting the user of an appointment that he has even if he is with the closed system, or else send a Push Notification using Cloud Messaging if possible.

How can I send a reminder SMS by taking an appointment saved in Firestore, checking the time and day, and sending an SMS or Push Notification without the user needing to be connected to the system?

I believe that I would have to have a service on a server running daily without stopping doing the readings in the database, but is there something on the Internet that does this for me without having to have a server of my own?

Author: Luiz Ricardo Cardoso, 2019-03-22

1 answers

Hello, you have two different things in your question.

First, how to run a direct service, this is totally not recommended, in the SaaS universe where Firebase is, this would generate a huge cost, the recommended in your case would be to use a cron job tool, such as https://www.easycron.com or https://runcloud.io / , the important thing is that it accepts schedules via API.

Second, send email, and sms automatically, you can use any service like https://sendgrid.com / and https://www.twilio.com / respectively, they have APIs for you to send the data

And the key that connects the two things are Firebase triggers, with them you can create a Function that is triggered whenever data is added in Firestore https://firebase.google.com/docs/functions/firestore-events?hl=pt-br

With this set you can, schedule a cron via api every time the data are added in firestore, and you can create another http function to be triggered not by trigger but by cron at the scheduled time, this second function would trigger the SMS, email, push APIs, or whatever else you want.

 0
Author: Rodolfo Patane, 2019-03-27 20:39:02