0

I need to calculate network usage programatically for my iOS application so I can put a limit for Celluar data usage and wifi usage monthly.

I made a lot of investigation and found the following approaches:

  • I can calculate the application network usage via personal VPN, but this solution is not preferred because a lot of user with agree to use VPN.

  • I can calculate the overall usage for network interfaces using getifaddrs, but not per application.

Any help on how to calculate network usage for my application without using personal VPN.

Abdelrahman
  • 997
  • 2
  • 10
  • 24

1 Answers1

0

Depending on which API you are using for network communication, you may be able to subclass the read and write interface and have it monitor the size of the data going across the interface.

Jordan Johnson
  • 669
  • 3
  • 16