I develop an app for watching TV, our company has a license to provide services inside only one country.
So the requirement is to get country in which the iPhone is currently physically located.
I've been searching for the answer on StackOverflow, found some great topics, but they don't completely meet requirements of this case:
Get device location (only country) in iOS - using CLLocationManager is unacceptable in our case, because it needs users to always keep Geolocation services on, draining phones' batteries, and us to request appropriate permission of users.
Find current country from iPhone device - using NSLocale is unacceptable in our case, because it provides just settings which the user has chosen his phone, it can be different from the country in which the iPhone is currently physically located.
iOS how to find country code of the user's phone number? - we tried to use CTCarrier, tested it sending the SIM card abroad: CTCarrier retured the code of country which the SIM card was emitted in, not the code of country which the iPhone is currently physically located in.
Roaming Status in iPhone - the only working solution I've found yet was detection of roaming status, but it uses non-documented system files, so I'm afraid that the app can be rejected by App Store if I use this:
static NSString *carrierPListSymLinkPath = @"/var/mobile/Library/Preferences/com.apple.carrier.plist";
static NSString *operatorPListSymLinkPath = @"/var/mobile/Library/Preferences/com.apple.operator.plist";
- (BOOL)isRoaming
{
NSFileManager *fm = [NSFileManager defaultManager];
NSError *error;
NSString *carrierPListPath = [fm destinationOfSymbolicLinkAtPath:carrierPListSymLinkPath error:&error];
NSString *operatorPListPath = [fm destinationOfSymbolicLinkAtPath:operatorPListSymLinkPath error:&error];
return (![operatorPListPath isEqualToString:carrierPListPath]);
}
How can this be solved? Please help.
Thanks in advance.