Get all subscribed topics from firebase cloud messaging(从 firebase 云消息传递中获取所有订阅的主题)
问题描述
使用新的 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 云消息传递中获取所有订阅的主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 firebase 云消息传递中获取所有订阅的主题
基础教程推荐
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- iOS4 创建后台定时器 2022-01-01
