How to use beginBackgroundTaskWithExpirationHandler for already running task in iOS

前端 未结 6 1519
悲哀的现实
悲哀的现实 2020-11-28 03:10

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

6条回答
  •  旧时难觅i
    2020-11-28 04:05

    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.

提交回复
热议问题