如何在 iOS 模拟器中更改 In-App priceLocale 产品的本地化? 我总是得到以欧元为单位的价格,但我无法将其换成美元。
例子:
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
NSArray *Books = response.products;
if ([SKPaymentQueue canMakePayments] && [response.products count]>0) {
}
for (SKProduct *book in Books) {
NSLocale *locat=[NSLocale currentLocale];
NSString *strlocate=[locat objectForKey:NSLocaleCountryCode];
NSLog(@"\n\n\n Device country== %@ \n\n\n",strlocate);
NSLocale* storeLocale = book.priceLocale;
NSString *storeCountry = (NSString*)CFLocaleGetValue((CFLocaleRef)storeLocale, kCFLocaleCountryCode);
NSLog(@"\n\n\n Store country== %@ \n\n\n",storeCountry);
}
}
设备国家==美国
商店国家== DE(总是DE,我不能改变它)
iOS 模拟器无法选择当前的 AppStore。 iOS Simulator AppStore select country问题有什么解决办法吗?
最佳答案
首先,模拟器根本不支持商店。您真的确定您是在 iOS 模拟器(在您的 Mac 上运行的应用程序)中运行它吗?
价格区域实际上由您使用的 Apple ID 的商店所在国家/地区决定,因为这是向用户收费的货币。因此您不能强制“始终以美元显示”或类似的东西(显然,简单地更改货币符号是错误的)。
但对于开发,您可以更改沙盒帐户的货币(或者更好:创建一个新帐户,以便您可以使用不同的货币进行测试)。参见 the "Viewing, Editing, and Deleting iTunes Connect Users" section in the "iTunes Connect Developer Guide" :
To Set your Preferred Currency
- Click on your name at the top right of the page.
- Select Personal Details.
- Choose your desired currency from the Preferred Currency dropdown.
- Click Save.
关于ios - 如何更改iOS模拟器中In-App priceLocale产品的本地化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36384053/