我想在通知中添加 JSON。我现在可以发送警报了。如何发送带有通知的 JSON?
我目前正在使用的代码片段:
PushNotificationPayload payload = PushNotificationPayload.complex();
payload.addAlert("Hello!!!");
payload.addBadge(1);
payload.addSound("default");
payload.addCustomDictionary("id", "1");
List<PushedNotification> NOTIFICATIONS = Push.payload(payload, "D:\\ios_dev.p12", "1234", true, "b3ead5d64ba0e08241e236f3ee041d8a9f036b39a0b0537e99a5f8b0607");
for (PushedNotification NOTIFICATION : NOTIFICATIONS) {
if (NOTIFICATION.isSuccessful()) {
System.out.println("PUSH NOTIFICATION SENT SUCCESSFULLY TO: " + NOTIFICATION.getDevice().getToken());
}
}
我想添加 JSON,如:
{
"message": message,
"m_id": mId,
"callNo": callNo
}
我怎么能通过这个?