Skip to content

Question: how to get NSURLSessionConfiguration used by Parse #614

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

Closed
oferRounds opened this issue Dec 1, 2015 · 7 comments
Closed

Question: how to get NSURLSessionConfiguration used by Parse #614

oferRounds opened this issue Dec 1, 2015 · 7 comments
Labels
type:feature New feature or improvement of existing feature

Comments

@oferRounds
Copy link

I would like set it protcolClasses, so I could monitor the netwrok request using this library here:

https://github.com/kasketis/netfox

by following this suggestion:
https://github.com/kasketis/netfox/blob/master/Workarounds.md#99

@richardjrossiii
Copy link
Contributor

If you're using CocoaPods (which you probably should be), you can modify -[PFURLSessionCommandRunner _urlSessionConfigurationForApplicationId:clientKey:] to add any additional configuration you'd like.

Allowing an easier public method to configure the URL session would be interesting, and probably falls under the scope of #570.

@oferRounds
Copy link
Author

Thanks!
I actually saw this method, and I am using CocoaPods. The thing is that I'm not sure how can I modify it, as my other 3rd party libaray is not embedded via Cocoa Pods (but included in my app main project). So I can't import it there...

Any thoughts?

And yes, that would be great if you could add a public method to get it.

@richardjrossiii
Copy link
Contributor

You could go the classic method swizzling route, though that does feel very hacky at that point. You could also fork Parse, and use your own fork of parse as your 'source of truth' for all of our dependencies (e.g. pod Parse :git => "https://github.com/oferRounds/Parse-SDK-iOS-OSX.git").

It definitely doesn't help that you're trying to tightly couple the network intercepting of a separate library to that of an unrelated library...

We do have PFNetworkWillSendURLRequestNotification and PFNetworkDidReceiveURLResponseNotification as events sent through NSNotificationCenter that you could observe as well.

@richardjrossiii
Copy link
Contributor

@oferRounds, I just added some preliminary APIs for configuring URL sessions & retry attempts that we use in the SDK, in #570. Let me know what you think, and if you have any thoughts please don't hesitate to share!

@oferRounds
Copy link
Author

Hi @richardjrossiii

I just updated my project to use 1.12.0 release.

Maybe I miss it, but I still don't see any available option to update the NSURLSessionConfiguration's protocolClasses.
Am I missing it, or is it still not available?

Thanks a lot again!

@richardjrossiii
Copy link
Contributor

@oferRounds We have removed that feature for the time being, as we decided that this sort of thing would be better configured by forking the SDK. I forgot to get back to you with this decision, and I apologize.

(Another option would be to swizzle NSURLSessionConfiguration and add those protocols to all NSURLSessions created by the system).

@oferRounds
Copy link
Author

@richardjrossiii - thanks! No problem :)

@mtrezza mtrezza added type:improvement type:feature New feature or improvement of existing feature and removed Discussion labels Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

3 participants