如何用anyhashble值解析jSON?
我的服务器应该像这样发送响应如何用anyhashble值解析jSON?,json,swift3,firebase-cloud-messaging,Json,Swift3,Firebase Cloud Messaging,我的服务器应该像这样发送响应 { title: fcmInboxObject.NotificationTitle, message : fcmInboxObject.NotificationText, tile: enums.NotificationCategories.SchoolCalendar, toId: studentItem._id, type: fcmInboxObject.NotificationType, reminder: fcmInboxObject.Notificatio
{
title: fcmInboxObject.NotificationTitle,
message : fcmInboxObject.NotificationText,
tile: enums.NotificationCategories.SchoolCalendar,
toId: studentItem._id,
type: fcmInboxObject.NotificationType,
reminder: fcmInboxObject.NotificationReminders
}
[AnyHashable("toId"): 581b7750af32d202243e864b, AnyHashable("type"): Type1, AnyHashable("collapse_key"): do_not_collapse]
remoteMessage [AnyHashable("reminder"): [], AnyHashable("tile"): SchoolCalendar, AnyHashable("from"): 327495396689, AnyHashable("title"): Holiiday Tomorrow, AnyHashable("message"): Holiiday Tomorrow Date: ]
但我得到的回应是
{
title: fcmInboxObject.NotificationTitle,
message : fcmInboxObject.NotificationText,
tile: enums.NotificationCategories.SchoolCalendar,
toId: studentItem._id,
type: fcmInboxObject.NotificationType,
reminder: fcmInboxObject.NotificationReminders
}
[AnyHashable("toId"): 581b7750af32d202243e864b, AnyHashable("type"): Type1, AnyHashable("collapse_key"): do_not_collapse]
remoteMessage [AnyHashable("reminder"): [], AnyHashable("tile"): SchoolCalendar, AnyHashable("from"): 327495396689, AnyHashable("title"): Holiiday Tomorrow, AnyHashable("message"): Holiiday Tomorrow Date: ]
我使用FCM作为通知和方法,我得到的是
func applicationReceivedRemoteMessage(_ remoteMessage: FIRMessagingRemoteMessage) {
print("remoteMessage \(remoteMessage.appData)")
}
为什么这个anyhashable在键之前?
有没有办法解析这种类型的JSON,或者我可以得到与服务器发送的相同的响应?也许您应该查看我找到的解决类似问题的解决方案,我希望它能有所帮助。也许你应该看看我为类似问题找到的这个解决方案,我希望它能有所帮助。