[英]Firebase Cloud Function schedule to create document
We have a Flutter project with Firebase setup we would like to create a Firebase cloud function with node js that perform the following: We have a Flutter project with Firebase setup we would like to create a Firebase cloud function with node js that perform the following:
Every 27th of any month check the subscription date from the subscription collection.每个月的 27 日从订阅集合中检查订阅日期。 And create a new document in invoices collection then finally send an email & FCM with a payment URL.
并在发票集合中创建一个新文档,然后最终发送 email 和 FCM 以及付款 URL。
For that you need to use a scheduled Cloud Function .为此,您需要使用 预定的云 Function 。
More precisely, you need to:更准确地说,您需要:
0 0 27 * *
, ie at 00:00 on day-of-month 27.0 0 27 * *
,即在每月 27 日的 00:00。 For the last 3 points, you need to use the Admin SDKs since you are coding in a Cloud Function.对于最后 3 点,您需要使用 Admin SDK,因为您在 Cloud Function 中进行编码。 ( Doc for Firestore and doc for Messaging )
( Firestore 文档和消息传递文档)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.