Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom NSURLSession configuration (#27701)
Summary: While it is possible in the React Native implementation for Android to provide a custom configuration for HTTP requests, the iOS implementation does not allow for the same customization. As the NSURLSession used for HTTP requests on iOS is configured internally, one may for instance not supply an ephemeral configuration for HTTP requests. Other concerns related to the given problem have been addressed in the community: react-native-community/discussions-and-proposals#166. I did make a PR with an RFC in the community repo, but after some discussion in the said repo, I figured I might as well make a PR with a suggestion :) ## Changelog [iOS] [Added] - Allow for configuring the NSURLSessionConfiguration Implement a C function `RCTSetCustomNSURLSessionConfigurationProvider` which gives the app programmer the ability to provide a block which provides an NSURLSessionConfiguration that will be used for all HTTP requests instead of the default configuration. The provided block will be called when the session configuration is needed. Pull Request resolved: #27701 Test Plan: Unsure if this can be tested in any other way than uncommenting the example code in `RNTester/RNTester/AppDelegate.mm`. Reviewed By: yungsters Differential Revision: D28680384 Pulled By: JoshuaGross fbshipit-source-id: ae24399955581a1cc9f4202f0f6f497bfe067a5c
- Loading branch information