Getting country calling prefix

Posted by Telkitty on Stack Overflow See other posts from Stack Overflow or by Telkitty
Published on 2012-10-29T04:52:46Z Indexed on 2012/10/29 5:00 UTC
Read the original article Hit count: 100

Filed under:
|
|

Just wondering whether there are easy ways to retrieve country calling code from a user's phone.

For example, my app would like to pre-fill country calling code for the users. If the user is located in the U.S. the code +1 will be returned, +83 for China, +61 for Australia etc.

I had a look around but I could only see:

NSLocale *locale = [NSLocale currentLocale]; NSString *countryCode = [locale objectForKey: NSLocaleCountryCnode];

Which returns the abbreviation for the country code, not the calling prefix?

Help is appreciated!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c