如何在Chrome中实现Google云消息-主题消息?

How to implement Google Cloud Messaging - Topic Messaging in Chrome?

Google Cloud Messaging for Chrome 文档中没有关于主题消息功能的信息。 https://developers.google.com/cloud-messaging/chrome/client

还没有吗?

这是没有订阅方法的 GCM 参考文档https://developer.chrome.com/apps/gcm

这里是 Android 和 iOS 参考以及提供 subscribe/unsubscribe 方法的 GcmPubSub class: https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmPubSub https://developers.google.com/cloud-messaging/ios/api/gcm/interface_g_c_m_pub_sub

遗憾的是它还没有实现。请联系这里:https://groups.google.com/forum/#!forum/gcm-for-chrome-feedback to get in touch with developers or file a feature request here: https://code.google.com/p/chromium/issues/list

发布答案以查看我评论的答案。


FCM 最近宣布(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.

Link Setting Up the JavaScript Client App.

的 Firebase 文档