2017-05-29 72 views
0

我们通过的appdelegate完成处理程序urbanairship并调用的appdelegate完成处理程序在年底手动城市飞艇调用UAAppIntegration.userNotificationCenter需要调用completionHandler?

func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping() -> Swift.Void) { 
    UAAppIntegration.userNotificationCenter(center, didReceive: response, withCompletionHandler: completionHandler) 
    completionHandler() 
} 

或我们所说的urbanairship完成

func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping() -> Swift.Void) { 
    UAAppIntegration.userNotificationCenter(center, didReceive: response) { 
     completionHandler() 
    } 
} 

,或者我们只是通过完成内的appdelegate完成处理到城市楼梯(那么如果我们有代码,我们需要在呼叫城市楼梯之前打电话给它)

func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping() -> Swift.Void) { 
    UAAppIntegration.userNotificationCenter(center, didReceive: response, withCompletionHandler: completionHandler) 
} 

回答

0

您想要做第二或第三选项。完成处理程序只能被调用一次。查看docs,了解您需要拨打UA的所有地点和示例。

+0

我想,但因为它是一个黑匣子,所以他们不会说他们是否会在完成处理程序时调用完成处理程序,或者如果我们处理了某些事情,我们就不应该将它转发给城市? – CiNN

+0

SDK是开源的,所以它不是一个真正的黑盒子。回调将始终由UA调用。 – ralepinski