0

使用 NSURLSession 处理后台上传的应用程序

backgroundSessionConfigurationWithIdentifier

并得到

handleEventsForBackgroundURLSession

当应用程序不在前台时正确回调应用程序委托。我的问题是:如果应用程序处于前台(即:runnig),我是否应该期望发生这种情况?原因是基于该调用,我向用户显示上传完成的消息。

或者我应该有自己的逻辑,一旦所有任务完成并且上传成功?

4

1 回答 1

0

I think handleEventsForBackgroundURLSession will never happen, if the application is foreground. if you want to show a message to user on foreground, please use <NSURLSessionDelegate, NSURLSessionTaskDelegate>

于 2015-07-17T09:31:02.417 回答