Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

I have added URLSessionProxyDelegate.enableAutomaticRegistration() to my project in the AppDelegate to track all network activity. This works on the simulator, but I've noticed that it does not seem to work on device. Interestingly, the demos in the Pulse repo do log the network activity on a device. Is there something I need to do besides adding that line to my project to make this work?

You must be logged in to vote

Replies: 1 comment · 5 replies

Comment options

Seems like public override func responds(to aSelector: Selector!) -> Bool in URLSessionProxyDelegate never gets called on a device. I've tried iPad, tvOS, iPhone. It all works on the simulator.

You must be logged in to vote
5 replies
@mmmcheese
Comment options

Actually, on further inspection the issue is that on device, swizzling is not taking place. I don't understand why.

@mmmcheese
Comment options

Error logs also indicate the swizzling is incorrect on device.

2023-03-10 10:11:09.164232-0800 Internal Test[6587:5557297] [API] API MISUSE: NSURLSession delegate Pulse.URLSessionProxyDelegate: <Pulse.URLSessionProxyDelegate: 0x280cdb450> (0x280cdb450) 2023-03-10 10:11:09.164466-0800 Internal Test[6587:5557297] [API] API MISUSE: task:willPerformHTTPRedirection:newRequest:completionHandler: completion handler not called 2023-03-10 10:11:09.331380-0800 Internal Test[6587:5557301] [API] API MISUSE: NSURLSession delegate Pulse.URLSessionProxyDelegate: <Pulse.URLSessionProxyDelegate: 0x280c96220> (0x280c96220) 2023-03-10 10:11:09.331619-0800 Internal Test[6587:5557301] [API] API MISUSE: task:willPerformHTTPRedirection:newRequest:completionHandler: completion handler not called

@kean
Comment options

kean Mar 11, 2023
Maintainer

I think we could do something like this to Nuke to avoid swizzling.

@mmmcheese
Comment options

I spent some time trying to debug it, and it's not clear to me why it doesn't work. I've tried a fresh project and did swizzling myself in a simple app, and it worked. But this one doesn't work for some reason...I wish I knew why.

@mmmcheese
Comment options

@kean I haven't happened to make any progress on this. It works great on the simulator, but not on device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.