I'm building a small IOS application rendering a web application via WebKitView.
I need to pass an extra information in the APNS payload to handle the routing of the app. Let's say your post has a new comment.
When reading the apple documentation here. I can see custom data can be added.
{
"aps" : {
"alert" : "You got your emails.",
"badge" : 9,
"sound" : "bingbong.aiff"
},
"url" : "https://domain.ext/post/1"
}
How can I access url from:
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
// if let page = response.notification["url"] as? String {
// print(url)
// }
completionHandler()
}
response.notification.request.content?