libphonenumber ios get country code for country

谁说我不能喝 提交于 2019-12-11 17:07:22

问题


Given a country, how do I get the countryCode? The following method is not working

NSNumber* code = [phoneUtil getCountryCodeForRegion:country];

回答1:


It is working, I used it like so:

[phoneUtil getCountryCodeForRegion:@"US"]

and the output was 1.

Note that you have to use the ISO Country Code, 2 Digit: "US", (you can find a list here).



来源:https://stackoverflow.com/questions/25879186/libphonenumber-ios-get-country-code-for-country

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!