android - Firebase 通知 - 无效的注册 token ,请检查 Android 中的 token 格式

标签 android firebase firebase-cloud-messaging firebase-notifications

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

Invalid reg token,please check token format

错误快照:

最佳答案

控制台中的 UserID 不是 Firebase 消息传递的注册 token 。通过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.

我的最后一个注册 token 看起来像 cpeBAC1NkUE:APA91bEpAKHQTdgkWVdDzDZG8BPon0APaIhbbuSejDpZF-FO1gD2saDV7_EQDo2WEz0H6e5U-uf0i-v4b25NXgGzV2oUrNuboM5675WY7VCP3JcBl8BCNY7eV0VFGHT9oRox0EEoo_ch

关于android - Firebase 通知 - 无效的注册 token ,请检查 Android 中的 token 格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42324784/

相关文章:

javascript - 无法在 firebase 实时数据库中存储新记录

android - 在 Android 中使用不同的 google-service.json 进行测试

android - FCM 允许消息数据存储吗?

android - FCM 启动器 Activity 并不总是打开

fragment 内的Android TabLayout

android - "Subject.asObservable()"和主题本身 "Subject"之间有什么区别吗?

android - 想在 Android 2.2 中进行拼写检查

android - 我如何将 View 放入钛的 View 中

javascript - Firebase 过滤器,其中值为

java - Android Notification Not getting Sound- FCM 使用 PHP