app-store - ios如何获取用户当地AppStore的货币?
大家讲道理
大家讲道理 2017-04-17 11:12:50
0
1
734

想要通过获取到用户的本地货币,来显示对应的价格列表。
比如用户是中国地区,显示人民币;在美利坚,显示美元;在香港,显示港元等。
请大家指教

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
Peter_Zhu

For this issue, you have to calculate the currency judgment and price conversion yourself.
What the api can do is to get the region or language of the current machine, etc., and based on this information you can decide what currency to display.
This information is in NSUserDefaults.

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    for (NSString *key in [[defaults dictionaryRepresentation] keyEnumerator])
    {
        NSLog(@"%@ = %@",key,[defaults objectForKey:key]);
    }

What you may need are the two keys AppleLocale and AppleLanguages ​​for judgment. The first value of AppleLanguages ​​is the current language.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template