使用Google云端功能在Firebase服务器上运行计时器? [英] Run timer on Firebase servers using Google Cloud Functions?

查看:278
本文介绍了使用Google云端功能在Firebase服务器上运行计时器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以在Android Studio中使用新的云端函数实现Firebase服务器端倒数计时器(例如:10小时倒计时)?



我希望定时器是服务器端,这意味着每当用户打开我的应用程序时,计数器将始终在所有用户的同一时间。 b $ b

解决方案

您目前没有提供类似计时器/ cron的工作。可以使用ping服务或类似 https://cron-job.org 来模拟行为,可能仍然适用于传统Google AppEngine实例+ Firebase Admin SDK


Is there a way to implement a Firebase server-side countdown timer (example: 10 hour countdown) in Android Studio using the new Cloud Functions?

I want the timer to be server side, meaning that whenever a user opens my app the counter will always be at the same time for all users.

解决方案

Google Cloud Functions does not currently provide timers / cron-like jobs.

You could emulate the behavior using a ping service or something like https://cron-job.org, that said this is probably still a good use for a "traditional" Google AppEngine Instance + the Firebase Admin SDK.

这篇关于使用Google云端功能在Firebase服务器上运行计时器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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