You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to know if it's possible to access the URLSessionDelegate, URLSessionDataDelegate & URLSessionTaskDelegate so we can respond to these delegate methods when needed. We're building an MVP on our current app using GraphQL instead of Rest. In our current setup we use the Pulse logger https://github.com/kean/Pulse for logging network requests in our app and we would like to re-use it for GraphQL calls too.
Thx!
The text was updated successfully, but these errors were encountered:
TripwireNL
changed the title
Access to URLSessionDelegate, URLSessionDataDelegate & URLSessionTaskDelegate
Access to URLSessionDelegate, URLSessionDataDelegate & URLSessionTaskDelegate for Pulse logger usage
Nov 19, 2024
Hi @TripwireNL - it's tricky because URLSessionClient needs to handle those delegate calls. Some of them have no implementation but many are important for NetworkFetchInterceptor to function correctly.
However, since URLSessionClient is an open class you could subclass it and override those delegate methods. You'll need to ensure you're calling the super implementation so that any expected work gets done in response to the delegate call though.
To make this work:
Initialize an instance of DefaultInterceptorProvider using your URLSessionClient subclass.
Use that instance of DefaultInterceptorProvider when you initialize the RequestChainTransportNetwork.
I think with that you should be able to do what you need but let me know if you get stuck.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.
Question
Hi,
I would like to know if it's possible to access the URLSessionDelegate, URLSessionDataDelegate & URLSessionTaskDelegate so we can respond to these delegate methods when needed. We're building an MVP on our current app using GraphQL instead of Rest. In our current setup we use the Pulse logger https://github.com/kean/Pulse for logging network requests in our app and we would like to re-use it for GraphQL calls too.
Thx!
The text was updated successfully, but these errors were encountered: