Does NSURLSessionDataTask get paused on background?

iOS Noob

I want to know about the behaviour of NSURLSessionDataTask in background.

Does NSURLSessionDataTask get paused right away (as soon as the app enters background)? or does iOS give some time hopefully 30 seconds or so until the response ?

Ketan Parmar

No, You will not continue with NSURLSessionDataTask in background mode with defaultSessionConfiguration !

If you want to continue execution in background then you need to configure session with backgroundSessionConfiguration.

When you are using backgroundSessionConfiguration you can't send data directly to server, you have to give file url and from that url you have to send bytes or chunks to server, and you have to use uploadTask or downloadTask with backgroundSessionConfiguration!!

If you wants little time after entering in background then you can use UIBackgroundTaskIdentifier. These are very huge concepts to explain every thing here, It's better that you read documentations from apple or some tutorial for that!!! You should refer Apple Documentation for Background Execution and Apple documentation for NSURLSession !

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Does main() get paused during signal handling?

From Dev

NSURLSessionDataTask in background session

From Dev

Does NSURLSession for HTTP data task (NSURLSessionDataTask) runs in background thread or we will have to provide the queue?

From Dev

android: how to make sure my app doesnt get paused when running in the background

From Dev

android: how to make sure my app doesnt get paused when running in the background

From Dev

How to get NSDictionary from NSURLSessionDataTask

From Dev

Converting NSURLSessionDataTask into a Download task with Background support

From Dev

iOS7 Background Synchronization (with NSURLSessionDataTask?)

From Dev

Converting NSURLSessionDataTask into a Download task with Background support

From Dev

running ssh process in background gets paused

From Dev

How to get status code from NSURLSessionDataTask?

From Dev

How to get data to return from NSURLSessionDataTask

From Dev

How to get data to return from NSURLSessionDataTask in Swift

From Dev

How does get_headers work in the background

From Dev

How to change the button background image when music is paused

From Dev

how to get raw JSON response from AFnetworking 2.0 operation / NSURLSessioNDataTask?

From Dev

How do I get a chart to redraw itself when the model is paused?

From Dev

Does each IntentService get its own background thread?

From Dev

Does application:performFetchWithCompletionHandler: get called if Background App Refresh is disabled in settings?

From Dev

NSURLSessionDataTask in appdelegate

From Dev

why does Virtualbox use 15-20% CPU when VM is paused?

From Dev

jQuery .val(#) does not change selection following AJAX call - works if debugging/paused

From Dev

location in the background does not work

From Dev

wc in background does not return

From Dev

background does not show in processing

From Dev

If I want a task to run in the background, how does the "dispatch_get_global_queue" queue work?

From Dev

When does a background task get aborted because of "ResourceRevocation", and how do I prevent it?

From Dev

Chain request using NSURLSessionDataTask

From Dev

NSURLSessionDataTask acting suspiciously slow

Related Related

  1. 1

    Does main() get paused during signal handling?

  2. 2

    NSURLSessionDataTask in background session

  3. 3

    Does NSURLSession for HTTP data task (NSURLSessionDataTask) runs in background thread or we will have to provide the queue?

  4. 4

    android: how to make sure my app doesnt get paused when running in the background

  5. 5

    android: how to make sure my app doesnt get paused when running in the background

  6. 6

    How to get NSDictionary from NSURLSessionDataTask

  7. 7

    Converting NSURLSessionDataTask into a Download task with Background support

  8. 8

    iOS7 Background Synchronization (with NSURLSessionDataTask?)

  9. 9

    Converting NSURLSessionDataTask into a Download task with Background support

  10. 10

    running ssh process in background gets paused

  11. 11

    How to get status code from NSURLSessionDataTask?

  12. 12

    How to get data to return from NSURLSessionDataTask

  13. 13

    How to get data to return from NSURLSessionDataTask in Swift

  14. 14

    How does get_headers work in the background

  15. 15

    How to change the button background image when music is paused

  16. 16

    how to get raw JSON response from AFnetworking 2.0 operation / NSURLSessioNDataTask?

  17. 17

    How do I get a chart to redraw itself when the model is paused?

  18. 18

    Does each IntentService get its own background thread?

  19. 19

    Does application:performFetchWithCompletionHandler: get called if Background App Refresh is disabled in settings?

  20. 20

    NSURLSessionDataTask in appdelegate

  21. 21

    why does Virtualbox use 15-20% CPU when VM is paused?

  22. 22

    jQuery .val(#) does not change selection following AJAX call - works if debugging/paused

  23. 23

    location in the background does not work

  24. 24

    wc in background does not return

  25. 25

    background does not show in processing

  26. 26

    If I want a task to run in the background, how does the "dispatch_get_global_queue" queue work?

  27. 27

    When does a background task get aborted because of "ResourceRevocation", and how do I prevent it?

  28. 28

    Chain request using NSURLSessionDataTask

  29. 29

    NSURLSessionDataTask acting suspiciously slow

HotTag

Archive