UNUserNotificationCenterDelegateの
userNotificationCenter(center: UNUserNotificationCenter, didReceiveNotificationResponse response: UNNotificationResponse, withCompletionHandler completionHandler: () -> Void)
を実装居ている場合は上記が呼ばれ、実装していない場合は
AppDelegateの
application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject])
が呼ばれる
UNUserNotificationCenterDelegateの
userNotificationCenter(center: UNUserNotificationCenter, didReceiveNotificationResponse response: UNNotificationResponse, withCompletionHandler completionHandler: () -> Void)
を実装している場合は上記が呼ばれ、実装していない場合は
AppDelegateの
application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void)
が呼ばれる
func userNotificationCenter(center: UNUserNotificationCenter, willPresentNotification notification: UNNotification, withCompletionHandler completionHandler: (UNNotificationPresentationOptions) -> Void) {
completionHandler([.Alert, .Sound])
}
UNNotificationServiceExtensionを作る必要があって特に調べてない 証明書周りがめんどくさそうだな!っておもってる