How to get separate price and currency information for an in-app purchase?

后端 未结 8 1517
攒了一身酷
攒了一身酷 2020-12-24 07:02

I am implementing in-app purchases for an app with support for several countries.

The In-App Billing Version 3 API claims that:

No currency co

8条回答
  •  猫巷女王i
    2020-12-24 07:29

    Very simple. SKU returns the currency code ("price_currency_code" field). With that code you can retrieve the symbol using the Currency class. See the code attached:

    String currencyCode = skuObj.getString("price_currency_code");
    currencySymbol = Currency.getInstance(currencyCode).getSymbol();
    

提交回复
热议问题