我想每天早上发一次HTTP请求,然后安排一个 UILocalNotification ,它会显示请求中的信息。
由于服务器要求,我不想使用推送通知。
我目前正在测试iOS7的Background Fetch api:
[application setMinimumBackgroundFetchInterval:60];
...
- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
// Get data
// Create UILocalNotification
}
问题是fetch无法保证。它可能执行得太频繁,甚至更糟 - 很少发生。
有更好的方法吗?