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
How to make it work with NSURLConnection #69
Comments
PonyDebugger should work out of the box with NSURLConnection. The reason it works with AFNetworking is because it uses NSURLConnection internally. Can you show me how you're using it, and also how you're integrating PonyDebugger? (make sure you call |
Apologies for the late reply, I was at work. But yes I have these on my appdelegate.m which I copied from the twitter example //#if ENABLE_PONYDEBUGGER
This is how I call my POST using NSURLConnection btw:
NSString *urlStringRequest = [NSString stringWithFormat:@"blaapi/%@/b/%@/m/%@?%@", self.eid, self.bid, self.Id, [WCFServiceRequest getauth]];
|
I'm seeing the same thing here. My guess is that using the static "sendSynchronousRequest" method which uses blocks bypasses the delegate process, which is what is used to hook into and monitor the communications. I'm pretty sure in this case the easy solution is to not use this static function. |
Just as a solution, I wrote a DNURLConnection class that makes it easy to replace the sendAsynchronousRequest with delegate functions....with only a single line change. https://github.com/ehlersd/DNURLConnection Just replace this line: [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {}]; with this line: [DNURLConnection connectionWithRequest:request completionHandler:^(NSURLResponse *response, NSData *data, NSError *error){}]; |
We're doing some housecleaning, so I'm going to close this issue since a solution has been proposed. Please reopen if this is still a problem. Thanks. |
So I've been trying to make it work with my app that uses NSURLConnection to call my APIs, and it's just now (after 3 days and comparing the PDTwitter example) that I realized the example project uses AFnetworking and that kinda affects if the requests get detected.
I basically tried changing (as a test) the one I used from NSURLconnection to ASJSonRequestOperation. Before it would see my app on the listener but will not list anything on the Network tab, now it would show details regarding the request.
Basically my question is, I'm not sure if the NSURLConnection that I used was wrong that's why it wasn't detected or if PonyDebugger just chooses to detect AFNetworking methods only?
I hope my question makes sense.
Thanks!
The text was updated successfully, but these errors were encountered: