【发布时间】:2023-03-27 15:38:01
【问题描述】:
我正在为 IAP 使用 Google Play 结算库。它工作正常,除了价格查询。
这是查询库存时返回的 JSON 的样子(从 logcat 检索的日志):
Got sku details:
SkuDetails:{
"title":"Remove ads",
"price":"1,10┬áÔé¼",
"type":"inapp",
"description":"No more ads",
"price_amount_micros":890000,
"price_currency_code":"EUR",
"productId":"remove_ads"
}
当我使用getPrice() 检索本地化价格时,它看起来像这样:1,10┬á?
我在onCreate()中这样初始化了iap helper
iap_helper = new IabHelper(this, app_key);
iap_helper.enableDebugLogging(true);
iap_helper.startSetup(this);
然后在onIabSetupFinished我打电话
iap_helper.queryInventoryAsync(this);
【问题讨论】:
-
检查我下面的答案。
标签: android in-app-billing in-app-purchase android-billing