Я не могу получить Data
словарь из push-уведомлений Firebase.
Мой код :
class func parseIncommingMessages(notification:UNNotification) {
print("PushNotifications: \n \(notification.request.content.userInfo.debugDescription)")
let userInfo = notification.request.content.userInfo as! [String: Any]
let dicDataContainer = userInfo["gcm.notification.data"] as? [AnyHashable:Any]
// notification
if let dicDataMain = dicDataContainer?["Data"] as? [String:Any] , let notificationType = dicDataContainer?["notificationType"] as? String
{
print("\nData: \(dicDataMain)")
print("\n NotificationType: \(notificationType)")
}
}
PushNotifications:
[AnyHashable("gcm.message_id"): 0:1544560847941727%a27b0018a27b0018, AnyHashable("google.c.a.e"): 1, AnyHashable("gcm.notification.data"): {"Data":{"Name":"a","message":"test","operation":"change"},"notificationType":"status_change"}, AnyHashable("aps"): {
alert = {
body = Somthing;
title = Somthing;
};
}]
Я не могу разобрать, пожалуйста, помогите мне ....