Normally iOS pauses (and later kills) the process after the Background event. You can ask the system to provide you more time to finish the task. The required code is added to the debugged app automatically to allow the debugger to stay connected even if the app has moved to the background.
Add this code and call it to allow your app to keep running in the background for a short time (should be enough for the request):
Code:
Sub Application_Background
Dim nativeMe As NativeObject = Me
nativeMe.RunMethod("moreBackgroundTime", Null)
End Sub
#If OBJC
- (void)moreBackgroundTime {
UIApplication* app = [UIApplication sharedApplication];
UIBackgroundTaskIdentifier bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
[app endBackgroundTask: bgTask];
}];
}
#end if