在Firebase位置发生更改时,最好的方法是全球设置警报 [英] Best way to globally set up alerts for when a Firebase location is changed

查看:114
本文介绍了在Firebase位置发生更改时,最好的方法是全球设置警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,我使用Firebase的其中一件事是存储用户提交的反馈 - 使用 push()将孩子添加到某个位置。理想情况下,无论何时将新的子项添加到该位置,我都可以收到一封电子邮件,但这只能通过一些Firebase服务直接完成,或者可能通过某些Firebase服务间接完成,这可能会触发一个URL(包含一个通过电子邮件发送给我的小脚本) ,但我找不到任何能力。



我能想到的一件事就像一个小的Node.js服务器不断运行,并听取该参考与 on('child_added',cb),当有事情发生变化时给我发电子邮件。我正在使用Firebase尝试在没有服务器的情况下构建此应用,所以我宁愿不必这样做。我想在个人电脑上做一个定期检查REST API的cron作业。任何更好的想法?解决方案

简单的解决方案是使用第三方服务。 Firebase与 Zapier 实现了很好的整合。通过此服务,您可以轻松地将Firebase与大量不同的服务和技术相集成,无需编写任何代码。其中一项技术是电子邮件。您可以免费创建一个zap,它将在服务器上运行,并自动监视Firebase路径的新子项,然后将该子项的信息作为电子邮件发送给您。这只需要几秒钟的设置,你不必写一行代码。


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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆