FCM(Firebase云消息传递)如何发送到所有电话? [英] FCM (Firebase Cloud Messaging) how to send to all Phones?

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

问题描述

我已经创建了一个小应用程序,可以从FCM控制台接收推送通知。



我现在要做的是向所有人发送推送通知Android手机获得应用程序使用API​​安装。而这就是我完全迷失的地方。
如果没有收集所有注册ID,是否无法将其发送给所有电话?
这只能用于控制台,不能用于API?

thanx

解决方案

只能通过Web控制台将消息发送到所有手机,例如您从Firebase Web控制台执行的操作。
如果您需要使用API​​中的此功能,您可以提交功能请求:
https://firebase.google.com/support/contact/bugs-features/



另一个可能性是让所有的客户端注册到通过 FirebaseMessaging.getInstance()。subscribeToTopic(topicName)



通过这种方式可以发送消息而不需要手动收集注册ID。

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

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?

thanx in advance

解决方案

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/

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

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

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

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