I know that I already accepted the answer for this (sorry!), But I found a solution:
[[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:60*5];
in
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
and adding fetch to UIBackgroundModes , which iOS then calls:
- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler
every 15-240 minutes (yes, it changes a lot, but it's better than nothing). Each time I get called to fetch, I connect to the periphery, synchronize and send my data to the server, and then disconnect. Since I send this data from the BLE peripheral to the server for processing / storage, I assume this is a legitimate (AppStore worthy) use of fetch .
CAVEAT: application:performFetchWithCompletionHandler: will not be called until iOS sets a user usage pattern for the application. In other words, you need to maintain the application (do not delete it) for about 24 hours or so before the application:performFetch... method is called. Boy, it took a while to figure it out!
UPDATE: Apple accepted my application that used this solution (approved in May 2014).
source share