Is it possible to programmatically create a network interface in iOS?

I am trying to add an indicator to my iOS application that will be displayed whenever a network call comes from my application. This means that the indicator should work even when calling AJAX from UIWebView / WKWebView. Instead of triggering an indicator from each delegate like UIWebViewDelegate, NSURLConnectionDeleaget or NSURLSessionDelegate, etc. I want to monitor the network interface and do this. I tried to getifaddrs()get the interface status / number of packets. But I could not distinguish the package that sends from my application and others.

So my question is:

  • I read that iOS does not support packet tracing. Is it possible to differentiate packages in any way?
  • Is it possible to create a virtual interface programmatically and route all connections? So that we can use getifaddrs()the interface on this.
  • Or is there another way to achieve this (call the indicator from one point without breaking the whole code)?
+4
source share

Source: https://habr.com/ru/post/1662857/


All Articles