当 Android 应用程序处于后台时,通知从支持的 (java) 发送但未在 android 中接收。
// This registration token comes from the client FCM SDKs.
String registrationToken = "YOUR_REGISTRATION_TOKEN";
// See documentation on defining a message payload.
Message message = Message.builder()
.putData("score", "850")
.putData("time", "2:45")
.setToken(registrationToken)
.build();
// Send a message to the device corresponding to the provided
// registration token.
String response = FirebaseMessaging.getInstance().send(message);
{
"data": {
"RIDE_KEY_LOCAL": "5759",
},
"android": {
"priority": "high",
"ttl": "7200s"
},
"registration_ids": [
"DDDD"
]
}
如何编写一个 (FCM)java 代码来给出上述类似的消息 (2)