I need to determine at startup what country a user is in, for an iPhone application. Presumably I will have to turn on location services and do some sort of reverse geocoding. I don't really want to use a third party web service if possible, are there any other suggestions for determining country from what location services provides?
Initially, I only need to check whether the user is inside the US or not, but this may change in the future to add more countries. I understand that location can not always be determined or the user may have location services turned off. Basically, I just need to know if the user is detected as being inside the US, in order to turn off a specific feature.
EDIT: On further reading, it looks like MKReverseGeocoder would be the way to go, except I don't wish to display any maps in my app, which means I'm not allowed to use this.
Go to Settings > General > About > ModelLook for the two letters before the slash (/) because that is significant to find out the country of origin of your iPhone. If the last two letters before the slash are 'LL' (see image below) then your iPhone's country of origin is USA.
Choose Settings, General, and then About, and find the model number. An Indian iPhone will have HN just before the slash. If the model number has HN before the "/" then its an Indian model.
Find My iPhone works abroad the same way it does at home, and you can access it via icloud.com or the Find My iPhone app on a friend's iPhone. If your phone is on and has signal, you'll be able to view its location, play a sound on it, or put it in Lost Mode.
Another trick you can try is checking the carrier’s MCC:
#import <CoreTelephony/CTTelephonyNetworkInfo.h> #import <CoreTelephony/CTCarrier.h> CTTelephonyNetworkInfo *netInfo = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier *carrier = [netInfo subscriberCellularProvider]; NSString *mcc = [carrier mobileCountryCode];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With