[ad_1]
So I’ve added didReceiveRemoteNotification delegate to deal with push notification, complete implementation is as follows:
func userNotificationCenter(_ middle: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
let userInfo: [AnyHashable : Any] = response.notification.request.content material.userInfo
handleNotifiation(userInfo, response.actionIdentifier)
completionHandler()
}
func utility(_ utility: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
refreshDataOnNotifications()
handleNotifiation(userInfo)
completionHandler(.newData)
}
As you may see, I am simply in a position to fetch motion identifier from didReceive methodology, However looks as if I am not getting any property which utilizing I can carry out the identical in didReceiveRemoteNotification methodology.
Thanks prematurely.
[ad_2]
