In my app I want to be able to detect if the cellular data usage is on for a particular application, and depending on the result of the check act appropriately.
Is there a way to perform this programmatic check?
In my app I want to be able to detect if the cellular data usage is on for a particular application, and depending on the result of the check act appropriately.
Is there a way to perform this programmatic check?
Go to the following link:
https://developer.apple.com/library/ios/samplecode/reachability/introduction/intro.html
download and import the header and iplementation file, then use this code:
Reachability *reachability = [Reachability reachabilityForInternetConnection];
NetworkStatus status = [reachability currentReachabilityStatus];
if (status == ReachableViaWWAN)
{
NSLog(@"Cellular data");
}
This project is a little old, you might need to turn ARC mode off see this answer:
© 2022 - 2024 — McMap. All rights reserved.