简体   繁体   English

如何在特定时间发送FCM通知?

[英]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.

相关问题 如何使用 fcm_django 在 IO 上发送推送通知 - How to send push notification on IOs using fcm_django Django:如何在特定用户活动上向管理员发送通知? - Django : How to send notification to admin on a specific user activity? 如何在pythonflask或segment中向特定用户发送Onesignal推送通知? - How to send Onesignal push notification to specific user in python flask or with segment? 在odoo中发送特定组的通知 - Send notification for specific group in odoo 如何在特定时间发送消息 TelegramBot - How to send message in specific time TelegramBot Kivy:在特定时间发送通知 - Kivy: Send Notification at certain time 是否可以在带有可扩展选项的推送通知中发送 Firebase(FCM) 通知消息(多行消息); 使用 Python? - Is it possible to send Firebase(FCM) notification message(multiple lined message) in the push notification with expandable option on it; using Python? 如何获取Android的FCM推送通知的注册令牌? - How to get registration token for FCM push notification for Android? 通过 django 频道向特定用户发送通知 - Send notification to a specific user by django channel 如何使用 Python(Instabot)每天在特定时间发送 instagram DM? - How to send instagram DM everyday at specific time using Python(Instabot)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM