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

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

问题描述

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

当我知道他们的ID时,能够成功发送通知给一组设备。 但是现在,我希望将通知发送到此处提及的主题: https://firebase.google.com/docs/cloud-messaging/topic-messaging



他们已经很好地记录了服务器端。但是我不知道如何订阅客户端的一个主题(我的客户端包括Chrome打包的应用程序,Web浏览器,针对不同平台的基于离子的移动应用程序。

那么,总结我如何让用户订阅主题?

请帮我解决。感谢您提前。



PS:我已经通过如何从javascript(for Chrome)注册到GCM主题,但没有多大帮助。

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


今天,我们宣布了Firebase云消息传递(FCM)的Web支持,并发布了一个JavaScript库。这扩展了我们当前的浏览器支持,使得实现过程变得更加简单,将强大的功能(例如主题和设备组消息传递功能)带到了网站上







使用FCM JavaScript库,您可以将Web推送通知发送到单个设备,主题或设备组。通过在Web上添加主题支持,我们可以让开发者向选择特定主题的Android,iOS和Web用户发送消息。要充分利用主题和设备组,您可以使用服务器端API 管理您的主题 groups subscriptions

链接到Firebase文档设置JavaScript客户端应用程序






我浏览过文档。 Chrome的Topic Messaging似乎仍然不适用于GCM 和。


I am working on sending push notifications with FCM.

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

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

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?

Please help me out. Thanks in advance.

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.

解决方案

Update: Announced just recently (October 17, 2016), 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.

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


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天全站免登陆