iOS how to find country code of the user's phone number?

后端 未结 1 470
一整个雨季
一整个雨季 2020-12-31 20:38

I have an app that needs to figure out the country code of the phone number the user has. My understanding is that I can\'t just get the phone number of the user, but, is th

相关标签:
1条回答
  • 2020-12-31 21:05

    You can get the country code with:

    NSString *cc = [carrier isoCountryCode];
    

    Which will give you US for a USA based device. You can map from country code to country phone code via the JSON data available on this.

    0 讨论(0)
提交回复
热议问题