我可以立即通过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
但是我找不到在特定时间向设备发送通知的方法,比如说03-10-2016 16:00:00
。