Reputation: 267
I am considering using a well-known third-party framework in my iOS application, which uses the camera. Unfortunately, it makes entirely unnecessary HTTP requests to the third-party's API, allowing them to capture and track things like device ID, device type, OS version, and other information. The calls are completely unnecessary to the framework's purpose, and the framework works perfectly fine when the network connection is unavailable/disabled.
My question is whether or not it's possible at the application level (i.e. via code or configuration) to intercept and/or block any calls made within the app to a specific host, like api.thirdparty.com.
Upvotes: 2
Views: 234
Reputation: 39512
You might be able to create a custom NSURLProtocol and register it to handle HTTP/HTTPS. Then filter which URL's you let through. You could start with this open-source project to guide you - it demonstrates how to pass some requests through to the system HTTP/HTTPS handler, and handle others yourself.
https://github.com/rnapier/RNCachingURLProtocol
Upvotes: 3