keenlabs/KeenClient-iOS — pull request #16 by brutella (2014-03-10 10:34:48+00:00)
Title: Call upload callback block also when no upload was necessary

Calling the upload block in all cases (also when no upload was necessary) is useful when you want to schedule the upload when the app enters the background.

In the case where the upload is called on `application:didEnterBackground`, a background task is started.

UIBackgroundTaskIdentifier taskId = [application beginBackgroundTaskWithExpirationHandler:^(void) {
NSLog(@"Background task expired.");
}];

[[KeenClient sharedClient] uploadWithFinishedBlock:^(void) {
[application endBackgroundTask:taskId];
}];

Calling background task `begin` has to be balanced with an `end` call, so I have to make sure that the upload finished block is called in every cases - also when no upload was necessary.