Detect country of iTunes Store in iOS [duplicate]

痴心易碎 提交于 2019-12-04 08:42:36

问题


In my iPhone app I would like to detect the country of iTunes Store the iPhone user is logged into, e.g. for a user from USA I would like to direct him/her to: https://itunes.apple.com/us/album/21/id420075073 and for a user who is logged into the Polish iTunes Store I would like to redirect him to: https://itunes.apple.com/us/album/21/id403037872

I know that I could check the locale (e.g. the language),but it might not always work.

Any ideas how to achieve this?


回答1:


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

will get you an identifier like e.g. "US" (United States), "ES" (Spain), etc.

Because you find country means no problem. We hope the iTunes store must be Device country.



来源:https://stackoverflow.com/questions/16212055/detect-country-of-itunes-store-in-ios

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