问题描述
使用新的 FirebaseMessaging,可以通过以下方式轻松取消/订阅主题:
Using the new FirebaseMessaging it's easy to un/subscribe to topics via:
FirebaseMessaging.getInstance().subscribeToTopic();
FirebaseMessaging.getInstance().unsubscribeFromTopic();
但是有没有办法获取当前安装订阅的所有主题?
But is there any way to get all topics the current installation is subscribed to ?
推荐答案
我搜索了 Android API,在 SO 上问了同样的问题,但没有找到任何东西.Android API 中没有任何内容可以获取特定令牌的所有主题.
I have searched Android API, asked questions for the same on SO but din't find anything. There is nothing in Android API to get all topics of a specific token.
https://iid.googleapis.com/iid/info/<TOKEN>?details=true
Content-Type:application/json
Authorization:key=AAA....i1nM:APA9.....81gTPXCE55....JLPEG0wZobG_ile8lI35JTzHYE5MC..BmDD_Cxj5OxB1Yh....Rs5lo3UwLNL9h-WcocGV....b5bYWNI55kzNsrHK-7GljUDtMn
TOKEN in url : FirebaseInstanceId.getInstance().getToken(senderId, scope);
key:可以在 firebase 控制台中找到:您的项目 ->设置->项目设置->云消息传递->服务器密钥
key : can be found in firebase console: Your project -> settings -> Project settings -> Cloud messaging -> Server Key
注意:找key时要小心,不要使用不同的web api key.
senderId可以在设置->中找到云消息传递->发件人 ID
senderId can be found in Settings -> Cloud Messaging -> Sender ID
scope 通常是 FCM"
这篇关于从 firebase 云消息传递中获取所有订阅的主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)