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
{{ message }}
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.
Does this pod not work with AFNetworking 3.0? I'm not able to get it to work. I'm passing in the NSURLSessionConfiguration I'm using to create a AFHTTPSessionManager but no files are ever created. Here's the code i use to setup the recorder:
NSLog(@"setting up traffic recorder");
self.recorder = [SWHttpTrafficRecorder sharedRecorder];
__weak BPDKAPIClient_Tests *weakSelf = self;
// This block determines the name that will be given to the file generated
// by each http request
self.recorder.fileNamingBlock = ^NSString*(NSURLRequest *request, NSURLResponse *response, NSString *defaultName)
{
NSString *name = [weakSelf fileNameForRequest:request];
NSLog(@"new name: %@, default name: %@", name, defaultName);
return name;
};
// This block determines if we will record the http request
self.recorder.recordingTestBlock = ^BOOL(NSURLRequest *request)
{
NSString *path = [weakSelf filePathForRequest:request];
NSLog(@"are we deciding to record?");
return ![[NSFileManager defaultManager] fileExistsAtPath:path];
};
// This line forces the singleton configuration to initialize it's session manager and by extension the session
// configuration. This way we can actually pass in the configuration to the recorder
__unused AFHTTPSessionManager *m = self.apiClient.apiClientConfig.httpSessionManager;
NSLog(@"config passed in: %@", self.apiClient.apiClientConfig.httpSessionManagerConfiguration);
[self.recorder startRecordingAtPath:bpdDir
forSessionConfiguration:self.apiClient.apiClientConfig.httpSessionManagerConfiguration
error:&e];
if (e)
{
NSLog(@"error recording: %@", e);
}`
The text was updated successfully, but these errors were encountered:
I wanted to point out that this might be because I use this with OHHTTPStubs, both pods attempt to register a protocol class so one of them wont be working, this is most likely why this wasn't working at the time. It should be noted in the documentation that this pod isn't compatible with pods that register a custom URLProtocol.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Does this pod not work with AFNetworking 3.0? I'm not able to get it to work. I'm passing in the NSURLSessionConfiguration I'm using to create a AFHTTPSessionManager but no files are ever created. Here's the code i use to setup the recorder:
`
NSError *e;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *bpdDir = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"BPDTests"];
The text was updated successfully, but these errors were encountered: