0
На iOS 10 метод didReceiveRemoteNotification не запускается, когда пользователь запускает приложение, нажав на push-уведомление. Как это исправить?На iOS 10, didReceiveRemoteNotification метод не запускается
На iOS 10 метод didReceiveRemoteNotification не запускается, когда пользователь запускает приложение, нажав на push-уведомление. Как это исправить?На iOS 10, didReceiveRemoteNotification метод не запускается
я думаю, что вам нужно сделать для ИОС 10,0
import UserNotifications
// didFinishLaunchingWithOptions method
if #available(iOS 10.0, *) {
let center = UNUserNotificationCenter.currentNotificationCenter()
center.delegate = self
center.requestAuthorizationWithOptions([.Alert, .Sound, .Badge], completionHandler: { (granted, error) in
// do nothing for now
})
}
Добавить расширение
extension AppDelegate: UNUserNotificationCenterDelegate {
@available(iOS 10.0, *)
func userNotificationCenter(center: UNUserNotificationCenter, didReceiveNotificationResponse response: UNNotificationResponse, withCompletionHandler completionHandler:() -> Void) {
// When app is killed and or in background tapping on this will resut this event
let payload = Payload(dict: response.notification.request.content.userInfo)
triggerThePaylod(payload)
}
}
я надеюсь, что это поможет вам