Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何用anyhashble值解析jSON?_Json_Swift3_Firebase Cloud Messaging - Fatal编程技术网

如何用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,或者我可以得到与服务器发送的相同的响应?

也许您应该查看我找到的解决类似问题的解决方案,我希望它能有所帮助。也许你应该看看我为类似问题找到的这个解决方案,我希望它能有所帮助。