android - 在 Android 的 FirebaseMessagingService 的 remoteMessage 中使用 getTo() 方法。我没有得到 getTo() 值
问题描述
我的 json 身体
{"to" : "registration_token", "notification" : { "body" : "Body of Your Notification", "title": "Title of Your Notification" } }
public void
onMessageReceived(RemoteMessage remoteMessage) {
PrintLog.log("Device Token :: ", remoteMessage.getTo());
if (remoteMessage.getNotification() != null) {
showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
}
}
在 PrintLog.log("Device Token :: ", remoteMessage.getTo()) 处获取空值;对于这条线
解决方案
推荐阅读
- azure - .net core 3.1 证书身份验证在 Azure 上部署时返回 403
- python - 使用熊猫逗号与分号分隔的csv文件
- python - pyplot mudole的show()函数发生UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb7 in position 0: invalid start byte
- mysql - 喜欢和总喜欢的数据库设计
- javascript - 无法理解为什么以下 JavaScript 函数不起作用
- angular - Html 画布不适合使用 html2pdf 库的 pdf 页面
- mysql - Vagrant Centos 6 box - MySQL - 找不到命令
- docker - 如何在后台捕获通过`docker-compose exec -d`运行的命令的日志?
- ios - 在 tableView 数据值 Swift 顶部添加或附加行的部分
- rows - 谷歌云Bigtable读取多行