我有firebase推送通知的问题 . 当应用程序处于后台模式时,推送时此2个功能同时调用

application(_ application:UIApplication,didReceiveRemoteNotification userInfo:[AnyHashable:Any],fetchCompletionHandler completionHandler:@escaping(UIBackgroundFetchResult) - > Void)func userNotificationCenter(_ center:UNUserNotificationCenter,didReceive response:UNNotificationResponse,withCompletionHandler completionHandler:@escaping() - > Void){

当app for forground这两个方法调用时

func userNotificationCenter(_ center:UNUserNotificationCenter,willPresent通知:UNNotification,withCompletionHandler completionHandler:@escaping(UNNotificationPresentationOptions) - > Void){application(_ application:UIApplication,didReceiveRemoteNotification userInfo:[AnyHashable:Any],fetchCompletionHandler completionHandler:@escaping(UIBackgroundFetchResult) ) - >无效)

我的问题是为什么我们需要在每种情况下调用didReceiveRemoteNotification时需要新的ios 10方法,我已经在iOS 10手机上进行了测试 .