无法读取FCM通知用户数据,我正在尝试这个-
let userInfo = response.notification.request.content.userInfo
if let jsonResult = userInfo as? Dictionary<String, AnyObject> //**Getting error on this line**
{
if let notifyType =
jsonResult["gcm.notification.notification_type"] as? String ?? ""
{
print(notifyType)
}
}
在你的代码中 取代:
if let notifyType =
jsonResult["gcm.notification.notification_type"] as? String ?? ""
{
跟:
if let notifyType =
jsonResult["gcm.notification.notification_type"] as? String {