3

I want to capture the total number of bytes sent/received through all network interfaces and particular interfaces of iPhone. I didn't find any help from Google about any similar code for this. Is there anyone can help me about an Objective C code for this?

Popeye
  • 11,839
  • 9
  • 58
  • 91
Shanaka
  • 1,670
  • 3
  • 21
  • 42
  • You might be able to use sysctl: http://stackoverflow.com/a/1385692/210171 – nielsbot Nov 13 '12 at 09:43
  • I found the correct answer for this question from [iPhone data usage tracking / monitoring][1] [1]: http://stackoverflow.com/questions/7946699/iphone-data-usage-tracking-monitoring – Shanaka Nov 15 '12 at 05:04
  • To calculate network traffic check [this](https://stackoverflow.com/questions/23131335/tracking-wifi-and-cellular-bytes-sent-and-received-by-each-process-app-in-ios). – Swapnali Sep 22 '20 at 11:10

2 Answers2

0

This is not accessible information, and you would violate the private framework rules if you tried accessing this on the device.

So I'm afraid it is not possible.

Nils Munch
  • 8,805
  • 11
  • 51
  • 103
  • This is not for an app that is going to distribute to apple appstore. I have separate enterprise license which I'm allowed to access the device information. also https://itunes.apple.com/us/app/data-counter-data-usage-for/id397348286?mt=8 this app seems to be contained the same functionality. – Shanaka Nov 13 '12 at 09:18
-2

IOS service layers

I don't think you can do it. As iOS Technology Overview mentioned, the function as you described is on Core Service level and not found in official documents. There may be some private APIs for it but Apple will definitely prevent you from using them.

So, I am sorry for that.

Ben Lu
  • 2,982
  • 4
  • 31
  • 54