Getting country calling prefix

0 votes

I was just curious if there were any simple methods for retrieving the country calling code from a user's phone.

For instance, I want my app to automatically fill in the users' country calling code.

Code +1 will be returned if the user is in the United States, +83 for users in China, +61 for users in Australia, etc.

I looked around, but all I saw was:-

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


which does not return the calling prefix but rather the country code abbreviation?

Please lend a hand!

Sep 19 in Others by Soham
• 9,330 points
21 views

1 answer to this question.

0 votes
For a class that offers both this data and phone number formatting, see:- https://github.com/rmaddy/RMPhoneFormat
answered Sep 20 by Aditya
• 7,660 points

Related Questions In Others

0 votes
0 answers

I am getting this data from my server

May 29, 2019 in Others by anonymous
176 views
0 votes
1 answer
0 votes
1 answer

I am getting Failed to load resource: net::ERR_BLOCKED_BY_CLIENT with Google chrome

These errors are usually generated from an ...READ MORE

answered Feb 16 in Others by Soham
• 9,330 points
1,161 views
0 votes
1 answer

Is there a way to to check if a picture was taken on that iPhone?

Actually, the model and manufacturer information is ...READ MORE

answered Sep 22 in IOS by Rahul
• 9,240 points
16 views
0 votes
0 answers

iPhone system font

What is the name of the default ...READ MORE

May 16 in Others by Kichu
• 19,040 points
28 views
0 votes
1 answer

iPhone system font

The iPhone system interface uses Helvetica or ...READ MORE

answered Sep 20 in Others by Aditya
• 7,660 points
19 views
0 votes
1 answer

white screen on simulator iphone Xcode

After creating the request, you must actually ...READ MORE

answered Sep 20 in Others by Aditya
• 7,660 points
25 views
0 votes
1 answer

Getting "net::ERR_BLOCKED_BY_CLIENT" error on some AJAX calls

Matching the URLs against a type of ...READ MORE

answered Feb 22 in Others by Aditya
• 7,660 points
214 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP