FCM(Firebase Cloud Messaging)如何发送到所有手机? [英] FCM (Firebase Cloud Messaging) how to send to all Phones?

查看:33
本文介绍了FCM(Firebase Cloud Messaging)如何发送到所有手机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个能够从 FCM 控制台接收推送通知的小应用.

I have created a small App that's able to receive Push Notifications from the FCM Console.

我现在想要做的是向所有使用 API 安装应用程序的 Android 手机发送推送通知.这就是我完全迷失的地方.有没有办法在不收集所有注册 ID 的情况下将其发送到所有电话?这是否仅适用于控制台而不适用于 API?

What i want to do now is to send a Push-Notifications to all Android Phones that got the app Installed using the API. And this is where i got completely lost. Is there no way to send it to all Phones without collecting all the registration-ids? Does this only work with the Console but not with the API?

提前谢谢

推荐答案

向所有手机发送消息,就像您在 Firebase Web 控制台中所做的一样,只能通过 Web 控制台进行.如果您需要 API 中的此功能,您可以提交功能请求:https://firebase.google.com/support/contact/bugs-features/

Sending a message to all the phones like what you do from the Firebase Web Console is only possible from the Web Console. If you need this feature from the API you can submit a feature request: https://firebase.google.com/support/contact/bugs-features/

另一种可能性是让所有客户端通过 FirebaseMessaging.getInstance().subscribeToTopic(topicName)

Another possibility is to have all the client registering to a specific topic via FirebaseMessaging.getInstance().subscribeToTopic(topicName)

通过这种方式,您可以向整个主题发送消息,而无需手动收集注册 ID.

In this way you can send a message to the whole topic without collecting the registration-ids manually.

这篇关于FCM(Firebase Cloud Messaging)如何发送到所有手机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆