Measure network traffic programmatically on iPhone

后端 未结 2 654
情深已故
情深已故 2020-12-28 09:06

I\'m interested in measuring the network traffic for my application. Ideally I would need to separate wireless from 3G network traffic. I can\'t seem to find any API that ge

相关标签:
2条回答
  • 2020-12-28 09:16

    I've found one approximate solution: getifaddrs can be used to get statistics on network usage.

    One advantage is that it can get separate statistics for Wi-Fi and WWAN interfaces.

    A disadvantage is that on multi-tasking devices those interfaces may be used by multiple applications and the statistics are cumulated.

    0 讨论(0)
  • 2020-12-28 09:39

    I also was looking for solution and found it here: iPhone Data Usage Tracking/Monitoring

    Please take a look this post, it provides all info that you need.

    0 讨论(0)
提交回复
热议问题