简体   繁体   English

DRF,Firebase FCM。 发送推送通知

[英]DRF, Firebase FCM. Sending push notifications

I am creating a DRF project and want to implement sending push notifications to devices.我正在创建一个 DRF 项目并希望实现向设备发送推送通知。

I have configured firebase in Django settings.我在 Django 设置中配置了 firebase。 But after that I faced a problem as I can't send test notification even from admin, I get an error: enter image description here但在那之后我遇到了一个问题,因为我什至无法从管理员那里发送测试通知,我收到一个错误:在此处输入图像描述

I understand that FCM registration token is required, but there is no way I can get it on backend side.我知道 FCM 注册令牌是必需的,但我无法在后端获取它。 Please advise if anyone has come across how is it possible to generate registration token on backend.请告知是否有人遇到过如何在后端生成注册令牌。

You should get the token on front.end side with JS, and also have functions for receiving messages in background/foreground on front.end.您应该使用JS在front.end端获取令牌,并且还具有在front.end的后台/前台接收消息的功能。 The token cand then be saved in your database or on firebase, whichever you preffer.然后可以将令牌保存在您的数据库或 firebase 中,无论您喜欢哪个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Kotlin 客户端应用程序中发送 FCM 推送通知 - Firebase 云消息传递 - Sending FCM Push Notification in Kotlin Client App - Firebase Cloud Messaging 使用带有世博会通知的 firebase 向特定用户发送推送通知 - Sending push notification to a specific user using firebase with expo notifications 发送推送通知时如何使用 FCM 发送 `apns-collapse-id`? - How to send `apns-collapse-id` using FCM when sending Push Notifications? 如何在不使用 Firebase 控制台的情况下使用 FCM 在 Flutter 应用程序中触发推送通知? - How to trigger push notifications in Flutter app using FCM without using the Firebase Console? 使用 AWS SNS 和 firebase 云消息传递 (fcm) 发送推送通知有什么好处 - whats the benefits of using AWS SNS with firebase cloud messaging(fcm) to send push notifications Firebase 功能推送通知 - Firebase Funtions push notifications 没有 FCM 后端的 Android 推送通知 - Android push notifications without FCM Backend FCM能否在Electron App中推送通知 - Can FCM push notifications in Electron App Flutter 使用 FCM 的推送通知在 iOS 上不起作用 - Flutter push notifications using FCM not working on iOS Android 的 FCM 推送通知无法直接用于令牌 - FCM push notifications for Android not working direct to token
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM