是否可以将 Firebase 推送通知发送到特定令牌以及主题
Is it possible to send Firebase push notification to specific token and also to the topic
我想通过指定 device-token
和特定的 Topic
来发送推送通知。
是否可以使用 Firebase admin-SDK
来做到这一点? The documentation 分别指定了 Topics
和 device-token
方法,但没有明确定义一起使用这两种方法。
admin.messaging().sendToDevice(tokens, payload)
admin.messaging().sendToTopic("TOPIC", payload)
没有 API(无论是在 Admin SDK 中,还是在幕后使用的 REST API 中)都无法通过一个单一的方式向主题和一组令牌发送消息打电话。
我能想到的最接近的方法是让这些设备订阅辅助令牌,然后 using an OR
condition to send to both topics。
我想通过指定 device-token
和特定的 Topic
来发送推送通知。
是否可以使用 Firebase admin-SDK
来做到这一点? The documentation 分别指定了 Topics
和 device-token
方法,但没有明确定义一起使用这两种方法。
admin.messaging().sendToDevice(tokens, payload)
admin.messaging().sendToTopic("TOPIC", payload)
没有 API(无论是在 Admin SDK 中,还是在幕后使用的 REST API 中)都无法通过一个单一的方式向主题和一组令牌发送消息打电话。
我能想到的最接近的方法是让这些设备订阅辅助令牌,然后 using an OR
condition to send to both topics。