【发布时间】:2020-01-22 11:22:14
【问题描述】:
我正在使用这个插件从我的 Django REST 应用程序发送推送通知。
https://github.com/xtrinch/fcm-django
它适用于 android 端,但 IO 无法接收任何通知。谁能告诉我我在这里想念什么。
以下是我的 fcm_django 配置:
FCM_DJANGO_SETTINGS = {
"APP_VERBOSE_NAME": "app-name",
"FCM_SERVER_KEY": "<firebase-server-key>",
"ONE_DEVICE_PER_USER": True,
"DELETE_INACTIVE_DEVICES": False,
}
以下是我用来向设备发送通知的代码:
data = {
"title": 'New Notification fired',
"body": 'I just fired a new notification'}
devices.send_message(data=data)
它会导致以下成功响应:
{'multicast_ids': [1212322313231212], 'success': 1, 'failure': 0, 'canonical_ids': 0, 'results': [{'message_id': '0:1579690926842318%a93f219bf9fd7ecd'}], 'topic_message_id': None}
我们非常感谢这方面的任何帮助。感谢您的时间。
【问题讨论】:
标签: python django-rest-framework firebase-cloud-messaging apple-push-notifications django-push-notifications