0

I'm trying to call multiple request from the share extension.

The request flow is follows

1. call request one - returns id
2. call request two using request one id 
3. call request three using request two id

To make this work, I only have to dismiss the extension sheet after the request three completion.

As per apple documentation we can't hold the extension sheet for a long time. So we have to use the background session for each request and dismiss the extension sheet immediately.

But in my case the requests depends on its previous request completion. So if we dismiss the extension sheet then the OS kills the extension from memory and the request two and three calls never be made.

Is there any way to call these request one by one?

Any suggestion will be helpful. Thanks in advance.

Surya Subenthiran
  • 2,217
  • 1
  • 15
  • 22
  • and what is exactly your problem. I suppose u use NSURLSessionDataTask or something similar and on the completion block of the first one you start the second one and so on – alecnash Nov 11 '15 at 18:16
  • yes @alecnash. we can do like this. but thing is, these request calls are made inside the share extension. As i mentioned in the question we can't display the share extension sheet for a long time. So we can't hold the sheet for three serial request to be complete. – Surya Subenthiran Nov 12 '15 at 05:48
  • The sheet can be open for a long time. In my extension I never had a problem with time and it never dismisses itself just so – alecnash Nov 12 '15 at 16:29

0 Answers0