我正在使用firebase和react native,我想在当前时间是晚上8点时为客户端显示一个通知,有什么方法可以监听时间戳吗?
发布于 2020-04-20 09:23:23
你可以使用Firebase调度云函数:https://firebase.google.com/docs/functions/schedule-functions
修改后的文档示例:
exports.scheduledFunctionCrontab = functions.pubsub
.schedule('0 20 * * *')
.timeZone('America/New_York') // Users can choose timezone - default is America/Los_Angeles
.onRun(context => {
console.log('This will be run every day at 20:00 Eastern!');
return null;
});
使用此工具为您想要的任何时间/间隔生成crontab语法:https://crontab.guru/
https://stackoverflow.com/questions/61318911
复制