Closed mhillebrand closed 2 years ago
I did some disassembling of the FAN framework with Hopper and found that it relies on WKWebView, and then I verified with Xcode's visual debugger that each FAN ad lives within an instance of WKWebView, which means NSURLProtocol won't work with FAN requests.
I did some Googling and found some interesting workarounds:
Since not all of my users will be on iOS 11, I converted the first solution to Swift, but I'm still not seeing FAN requests with Netfox:
extension NFXProtocol {
public class func wk_registerScheme(_ scheme: String) {
guard let contextController = NSClassFromString("WKBrowsingContextController") as? NSObjectProtocol else { return }
let selector = Selector(("registerSchemeForCustomProtocol:"))
if contextController.responds(to: selector) {
_ = contextController.perform(selector, with: scheme)
}
}
public class func wk_unregisterScheme(_ scheme: String) {
guard let contextController = NSClassFromString("WKBrowsingContextController") as? NSObjectProtocol else { return }
let selector = Selector(("unregisterSchemeForCustomProtocol:"))
if contextController.responds(to: selector) {
_ = contextController.perform(selector, with: scheme)
}
}
}
This seems like a lot more testing needs to happen
I added a WKWebView to the sample project. We can use this for testing the proposed solution. I haven't gotten a chance to write an actual fix yet though
Closing this as already make task in project for that https://github.com/kasketis/netfox/projects/1#card-76856365
I love Netfox, but I'm unable to see requests made to *.facebook.com from Facebook's FAN SDK:
https://origincache.facebook.com/developers/resources/?id=FBAudienceNetwork-4.26.1.zip
It's a dynamic framework, so I'm not sure how their HTTP requests are being made exactly. Any ideas?
Thanks, Matt