URLSession.datatask with request block not called in background

后端 未结 4 1093
轻奢々
轻奢々 2020-11-29 06:08

URLSession data task block is not calling when the app is in background and it stuck at dataTask with request.
When I open the app the block ge

4条回答
  •  悲&欢浪女
    2020-11-29 06:42

    You need a background session. The URLSessionDataTask which as per Apple's documentation doesn't support background downloads.

    Create a URLSessionDownloadTask and use its delegate method it should work.

    Follow this link

提交回复
热议问题