In my app, I am uploading images to server from iPhone. While sync if user press home button, App will close.
I want app must be running in background till sync fini
You should run your task after beginBackgroundTaskWithExpirationHandler or capture notification when the application change app's state to background and then cancel your current task and run again with beginBackgroundTaskWithExpirationHandler.
beginBackgroundTaskWithExpirationHandler