I am following the tutorial at: https://cloud.google.com/solutions/mobile/firebase-app-engine-android-studio
I have everything working and the email is sending every
Your question is actually a question about AppEngine and how to create a Servlet that starts automatically and automatically performs some initialization.
You will want to keep manual scaling on, but follow the steps here: https://cloud.google.com/appengine/docs/java/config/appconfig#using_a_load-on-startup_servlet
for setting up your listeners on init() instead of an http request. What you are trying is definitely possible and have seen it run elsewhere.
Simple answer is you can't do that yet. Google cloud endpoints have a timeout of 1 min. Cron jobs also have a timeout.
What you need is triggers. This feature was demoed at Google io 16. Whenever data changes, a rest request is fired from firebase to a server and path of your choice.
Even I am waiting for this to arrive soon.