订阅 FCM for Chrome 中的主题 [英] Subscribe to Topics in FCM for Chrome

本文介绍了订阅 FCM for Chrome 中的主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am working on sending push notifications with FCM.

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

I am able to send notifications successfully to a set of devices when I know their IDs.

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

But now, I want to send notifications to a topic as mentioned here: https://firebase.google.com/docs/cloud-messaging/topic-messaging

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

They have documented the server side pretty well. But I am not sure how to subscribe to a topic on the client side (My client includes chrome packaged app, web browsers, ionic based mobile application for different platforms.)

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

So, in summary how do I make users subscribe to topics?

请帮帮我.提前致谢.

PS:我确实经历了 如何从 javascript(适用于 Chrome)如何在 Chrome 中实现 Google Cloud Messaging - Topic Messaging? 但这并没有太大帮助.

PS: I did go through How to get registered into GCM topics from javascript (for Chrome) and How to implement Google Cloud Messaging - Topic Messaging in Chrome? but it did not help much.

推荐答案

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

Update: Announced just recently (October 17, 2016), Firebase JavaScript library:

今天,我们发布了一个 JavaScript 库,宣布对 Firebase 云消息传递 (FCM) 的网络支持.这扩展了我们当前的浏览器支持,实现了显着简化的实施过程,并为网络带来了强大的功能,例如主题和设备组消息传递.

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.

--

使用 FCM JavaScript 库,您可以将网络推送通知发送到单个设备、主题或设备组.通过在 Web 上添加主题支持,我们使开发人员可以向选择加入特定主题的 Android、iOS 和 Web 用户发送消息.要利用主题和设备组,您可以使用服务器端 API 管理您的主题群组订阅.

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.

设置 JavaScript 客户端应用的 Firebase 文档链接.

Link to the Firebase documentation for Setting Up the JavaScript Client App.

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

I've looked around the docs. It seems that Topic Messaging for Chrome still isn't available for GCM and FCM.

这篇关于订阅 FCM for Chrome 中的主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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