Web Firebase云消息传递-如何从客户端订阅主题? [英] Web Firebase Cloud Messaging - How to subscribe to a topic from client side?

查看:60
本文介绍了Web Firebase云消息传递-如何从客户端订阅主题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用FCM来接收Web应用程序上的推送通知.现在,我想从Web应用程序中订阅特定主题.有什么办法吗?如果是,那这是安全的安全方法吗?

I have to use FCM to receive push notifications on my web application. Now I want to subscribe to a particular topic from the web app. Is there any way to do this? if yes then is it safe the safe way to do?

还是应该从服务器端完成主题订阅?

Or subscribe to a topic should be done from server side?

推荐答案

Firebase Cloud Messaging的客户端Web SDK不支持订阅主题.如果要为Web客户端订阅FCM主题,则必须通过

The client-side web SDK for Firebase Cloud Messaging does not support subscribing to topics. If you want to subscribe your web clients to FCM topics, you will have to do so from server-side code, either through the Admin SDK or through the corresponding REST APIs.

这篇关于Web Firebase云消息传递-如何从客户端订阅主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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