2016-09-26 2 views

ответ

1

я думаю, что вам нужно сделать для ИОС 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) 
} 

}

я надеюсь, что это поможет вам

Смежные вопросы