I have the following method:
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
//print(userInfo)
// Print APS.
let aps = userInfo["aps"]
let itemId = aps!["category"] as! String
print("ITEM ID: \(itemId)")
let temp = Int(itemId)
if (temp > 0) {
print("handle item details”)
} else {
print("open home")
}
}
The line let aps = userInfo["aps"]
gives the following error
Cannot subscript a value of type '[NSObject : AnyObject]' with an index of type 'String'