をセットアップするためにすべての手順に従いましたが、AppDelegate でbackground fetch
関数を作成するときに間違いを犯したのではないかと疑っています。performFetchWithCompletionHandler
これは、シミュレートするとすぐに表示される警告ですbackground fetch
Warning: Application delegate received call to - application:
performFetchWithCompletionHandler:but the completion handler was never called.
これが私のコードです:
func application(application: UIApplication, performFetchWithCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
if let tabBarController = window?.rootViewController as? UITabBarController,
viewControllers = tabBarController.viewControllers as [UIViewController]! {
for viewController in viewControllers {
if let notificationViewController = viewController as? NotificationsViewController {
firstViewController.reloadData()
completionHandler(.NewData)
print("background fetch done")
}
}
}
}
が機能しているかどうかをテストするにはどうすればよいbackground-fetch
ですか?