android - 在 FCM for Chrome 中订阅主题

标签 android firebase google-cloud-messaging google-chrome-app firebase-cloud-messaging

我正在使用 FCM 发送推送通知。

当我知道它们的 ID 时,我能够成功地向一组设备发送通知。

但是现在,我想向此处提到的主题发送通知:https://firebase.google.com/docs/cloud-messaging/topic-messaging

他们很好地记录了服务器端。但我不确定如何在客户端订阅主题(我的客户端包括 chrome 打包应用程序、网络浏览器、适用于不同平台的基于 ionic 的移动应用程序。)

那么,总而言之,我该如何让用户订阅主题?

请帮帮我。提前致谢。

PS:我确实通过了How to get registered into GCM topics from javascript (for Chrome)How to implement Google Cloud Messaging - Topic Messaging in Chrome?但这并没有太大帮助。

最佳答案

更新:最近才宣布(2016 年 10 月 17 日),Firebase JavaScript library :

Today we're announcing web support for Firebase Cloud Messaging (FCM) with the release of a JavaScript library. This extends our current browser support, enables a dramatically simpler implementation process, and brings powerful features such as Topics and Device Group Messaging to the web.

--

With the FCM JavaScript library, you can send web push notifications to single devices, topics or groups of devices. With the addition of topic support on the Web, we are making it possible for developers to send a message to their Android, iOS and Web users who have opted in to a particular topic. To take advantage of topics and device groups, you can use the server-side APIs to manage your topics and groups subscriptions.

Setting Up the JavaScript Client App 的 Firebase 文档链接.


我查看了文档。 Chrome 的主题消息传递似乎仍不适用于 GCM 和 FCM

关于android - 在 FCM for Chrome 中订阅主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38085728/

相关文章:

java - 如何始终在 Recyclerview 中显示完整项目而不是项目的一部分?

android - SIGNAL 11 SIGSEGV 崩溃 Android

android - 在android应用程序中访问手机的内部存储?

javascript - Firestore 对查询进行分页

javascript - Fetch POST 请求不返回使用 res.send ('sampletext' 发送的响应;

android - 通知中的未决 Intent 未被清除

android - 具有 ListView 和多对多关系的内容提供者

javascript - 从 Firebase 获取图像 URL

android - 应用内消息与推送消息 : Pros and Cons

java - gcm - 是否可以知道消息是否发送到离线设备?