在使用 Postman 进行测试时,我通过FCM API将推送令牌发送到特定设备,但我打算从服务器发送它们。
{
"to" : "my_device_token",
"notification" : {
"notificationTitle" :"test from server",
"notificationBody" :"test lorem ipsum"
}
}
Run Code Online (Sandbox Code Playgroud)
我收到回复
{
"multicast_id": 4996861050764876123,
"success": 1,
"failure": 0,
"canonical_ids": 0,
"results":
[
{
"message_id": "0:1519567530487886%f95ee7d4f95ee123"
}
]
}
Run Code Online (Sandbox Code Playgroud)
这显示没有错误,但是我的手机上没有收到任何通知。我在 firebase 网站“通知 => 新消息 => 单个设备”上尝试使用相同的设备令牌,并且它有效。
我看到有关在应用程序未运行时未收到通知的线程,但是即使应用程序正在运行,我也没有收到任何通知。
编辑:如果相关,我的应用程序是使用 Xamarin.Android 构建的。
android push-notification xamarin.android firebase firebase-cloud-messaging