Firebase通知 - 注册令牌无效,请在Android中检查令牌格式 [英] Firebase Notifications - Invalid reg token, please check token format in Android

查看:2014
本文介绍了Firebase通知 - 注册令牌无效,请在Android中检查令牌格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我通过从Firebase控制台选择包发送推送消息,推送到所有设备,但在发送到个人设备,它显示错误:

 注册令牌无效,请检查令牌格式

错误快照:

[] [1]

解决方案

Firebase消息的注册标记。通过 Firebase文档


在您的应用程序初始启动时,FCM SDK为客户端应用程序实例生成注册令牌。如果您想定位单个设备或创建设备组,则需要通过扩展FirebaseInstanceIdService来访问此令牌。


我上一次注册令牌看起来像
cpeBAc1NkUE:APA91bEpAKHQTdgkWVdDzDZG8BPon0APaIhbbuSejDpZF-FO1gD2saDV7_EQDo2WEz0H6e5U-uf0i-v4b25NXgGzV2oUrNuboM5675WY7VCP3JcBl8BCNY7eV0VFGHT9oRox0EEoo_ch

![enter image description here][1]

If I send push message by selecting a package from Firebase console, the push goes to all devices, but during sending to individual device, it displays the error:

Invalid reg token,please check token format

Error Snapshot:

[][1]

解决方案

UserID in console is not the registration token for Firebase messaging. By Firebase docs:

on initial startup of your app, the FCM SDK generates a registration token for the client app instance. If you want to target single devices or create device groups, you'll need to access this token by extending FirebaseInstanceIdService.

My last registration token looks like cpeBAc1NkUE:APA91bEpAKHQTdgkWVdDzDZG8BPon0APaIhbbuSejDpZF-FO1gD2saDV7_EQDo2WEz0H6e5U-uf0i-v4b25NXgGzV2oUrNuboM5675WY7VCP3JcBl8BCNY7eV0VFGHT9oRox0EEoo_ch

这篇关于Firebase通知 - 注册令牌无效,请在Android中检查令牌格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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