How to switch off iPhone Internet and data package network connection?
I want to make an application that tracks the total consumption of Internet data or in other words a data tracker. If the set limit is reached I want the 开发者_如何学编程Internet data package connection to be disabled.
Is it possible with the iPhone SDK? If yes, then which API and the library should I be looking at?
Manipulating the core system preferences (disabling data packages) and measuring packages sent and received are both outside the "quarantine-zone" of the Apple Developer Guidelines.
If you DO happen to find some tricky way to do this (that is, the private iOS frameworks) you must know that your app will never be approved.
The closest thing that comes to this was the talk about a statistics API, where apps could see the number of calls made, data transferred, etc. But this was not very well looked upon by the approval board, and will probably not be a reality any time soon.
You can't do this without going the jailbreak route. What you could possibly do is maybe show a notification to the user if they are near to reaching the limit.
To get the amount of data consumed, some service providers provide APIs (I'm thinking of the consume app) where you can get the data consumed and data left from the provider side.
精彩评论