- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
[[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:
UIApplicationBackgroundFetchIntervalMinimum];
}
我设置了上面和下面的最小时间间隔,当app在后台时,方法工作正常并且获取数据10分钟(因为我设置了最小时间间隔)。
- (void) application: (UIApplication *)application performFetchWithCompletionHandler:
(void(^) (UIBackgroundFetchResult))completionHandler{
fetch data....
}
上面的performFetchWithCompletionHandler:方法会在应用程序被杀死时运行???