-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTPNetworkTransport still using completion handler blocks #732
Comments
Remind me why a completion handler can't be used in a background session? I thought when you got the background wakeup call you got a completion block to fire when your action had completed. |
I thought it too, but when I'm getting the following crash when fetching the query.
The reason I would say is that the completion handler blocks may have been deallocated while the app is in background |
Blargh. Will take a look when I get back. |
👋 any update on this? |
Not at the moment - I think we're probably going to have to add some additional protocol methods to make this work correctly, and I'm in the middle of about 14 other things. Would be more than happy to look at a pull request if you've got more time! |
This is very important, as Apple is going to reject apps that have a Share extension that starts uploads configured without a background session. |
@kroussevrb Thanks for the heads up - again, I'm swamped with a couple other things but would be more than happy to look at a PR if you have some time! |
TWIMC, I've just released ApolloAlamofire 0.6.0, which is updated for Apollo 0.19.0 and allows using an Alamofire delegate for the Apollo transport. |
This is great, now the only thing missing is a pure Apollo solution for those of us who can't afford to import Alamofire as a dependency. I am aware of the suggestion to submit a PR for that but I don't know if I will be able to get around to it (or even if I do, not sure it will be the best solution as I am not familiar with Apollo's source code) |
Any update on this functionality? :) |
Gonna be a bit - I've been doing some exploration around this and some other restructuring of the networking stack for HTTP recently, but I need to get it more stable before I write up a CFP. |
@designatednerd Right on! Thanks so much for the quick reply. Love this SDK and everything about Apollo! |
I rewrote the network transport to be able to handle this but my implementation is very specific to our project, so can't help out here. |
Hi folks, I finally got something that will work with a background session functional. Please check out #1163, I would love your feedback. |
This has (finally) shipped with |
Hey Can anyone please share the right way of configuring apollo for the background task to work. earlier i was using 0.21.0 for all foreground tasks and now updated to 0.27.0 so as to hit api from background. |
Hi! You can pass the background session configuration you receive from the system into a Does that help? |
You also have to implement the background session delegates to handle download progress and response.
…On 30. Jul 2020, 17:21 +0200, Ellen Shapiro ***@***.***>, wrote:
Hi! You can pass the background session configuration you receive from the system into a URLSessionClient, since that takes a session configuration. Then, you pass that client into the initializer for HTTPNetworkTransport.
Does that help?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@diegoventura are you talking about the delegates on |
This is code I am using to instantiate apollo client. |
Here's all of Apple's documentation about how to get a background session. You'll probably want to make your |
The latest release (
0.15.0
) introduced the ability to use aURLSession
instead of aURLSessionConfiguration
, this allows using a background session on theHTTPNetworkTransport
.However,
HTTPNetworkTransport
is still using completion handler blocks, which are not supported in a background session, instead of using a delegate for that.Do you have any plans to change this behavior so
HTTPNetworkTransport
is always using a delegate instead of completion handler blocks?The text was updated successfully, but these errors were encountered: