在Firebase位置发生更改时,最好的方法是全球设置警报 [英] Best way to globally set up alerts for when a Firebase location is changed
问题描述
push()
将孩子添加到某个位置。理想情况下,无论何时将新的子项添加到该位置,我都可以收到一封电子邮件,但这只能通过一些Firebase服务直接完成,或者可能通过某些Firebase服务间接完成,这可能会触发一个URL(包含一个通过电子邮件发送给我的小脚本) ,但我找不到任何能力。 我能想到的一件事就像一个小的Node.js服务器不断运行,并听取该参考与 on('child_added',cb)
,当有事情发生变化时给我发电子邮件。我正在使用Firebase尝试在没有服务器的情况下构建此应用,所以我宁愿不必这样做。我想在个人电脑上做一个定期检查REST API的cron作业。任何更好的想法?解决方案
One of the things I'm using Firebase for in my app is to store user-submitted feedback - using push()
to add children to a location. Ideally I could receive an email whenever a new child was added to that location, but this could only be done directly by some Firebase service, or perhaps somewhat indirectly by some Firebase service that could hit a URL (containing a tiny script that emails me), but I can't find any mention of either ability.
One thing I can think of is something like a little Node.js server constantly running and listening to that reference with on('child_added', cb)
, emailing me when something changes. I'm using Firebase to try to build this app without having a server, so I'd rather not have to do that. I'm thinking of just having a cron job on my personal computer that periodically checks the location over the REST API. Any better ideas?
The easy solution is to use a third-party service. Firebase has really great integration with Zapier. This service allows you to easily integrate Firebase with tons of different services and technologies without writing any code. One of these technologies is email. You can create a "zap", for free, which will run on their servers and automatically watch for new children of a Firebase path then send that child's information to you as an email. It's only takes seconds to set up and you don't have to write a line of code.
这篇关于在Firebase位置发生更改时,最好的方法是全球设置警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!