[英]How to send FCM notification at specific time?
I can be able to send FCM notifications to single or multiple devices through PyFCM instantly. 我可以立即通过PyFCM将FCM通知发送到单个或多个设备。
# Send to single device.
from pyfcm import FCMNotification
push_service = FCMNotification(api_key="<api-key>")
# OR initialize with proxies
proxy_dict = {
"http" : "http://127.0.0.1",
"https" : "http://127.0.0.1",
}
push_service = FCMNotification(api_key="<api-key>", proxy_dict=proxy_dict)
# Your api-key can be gotten from: https://console.firebase.google.com/project/<project-name>/settings/cloudmessaging
registration_id = "<device registration_id>"
message_title = "Uber update"
message_body = "Hi john, your customized news for today is ready"
result = push_service.notify_single_device(registration_id=registration_id, message_title=message_title, message_body=message_body)
print result
But I can't find a way to send notification to devices at specific time, say 03-10-2016 16:00:00
. 但是我找不到在特定时间向设备发送通知的方法,例如
03-10-2016 16:00:00
。
If you're looking for a public API of FCM for a scheduled push or a payload parameter where you can set the push date, unfortunately, there's nothing like it as of the moment. 不幸的是,如果您正在为计划的推送或有效负载参数寻找FCM的公共API,可以在其中设置推送日期,那么到目前为止,还没有类似的东西。
You must implement your own App Server and implement the scheduled push yourself (also mentioned it here ). 您必须实现自己的App Server并自己实现计划的推送( 在此处也提到了 )。
My answer from the tagged duplicate post. 我的回答来自加标签的重复帖子。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.