Reputation: 40734
I am building an Android app with in-app billing and want to do two things:
I have determined that there is no way to query the Android Market for the prices, similar to the way you can query the Apple App Store. That being said, I'm willing to add an API call on my server that returns the prices that I've setup in the Android Market admin.
The problem then becomes - how do I know what currency to show the prices in? Is there a way for me to figure out at run time what currency the user's Market will show, such that I can add an argument to the new API call and display the correct currency and price from within the app?
Thanks in advance.
Upvotes: 5
Views: 6564
Reputation: 40734
This is now supported by In-app billing Version 3.
From the docs:
Usually, you'll want to inform the user of the products that are available for purchase. To query the details of the in-app products that you defined in Google Play, your application can send a getSkuDetails request. You must specify a list of product IDs in the query request. If the request is successful, Google Play returns a Bundle containing product details including the product’s price, title, description, and the purchase type.
Upvotes: 4
Reputation: 52936
Not really. You need to know what countries support prices in local currency (you can look it up in the dev console, new countries are added from time to time). Then, based on the current country (from SIM code, etc), lookup the local price and return the value. If there is no local price set, currency convert your base price for an estimate. All in all not trivial, and should be part of the IAB API really. If you go through with it, do open source it :)
Upvotes: 2
Reputation: 564
I've found a currency conversion API however I've no experience using it. If it works I would look into coding a ISO country code to ISO currency code index. The current country code is available in the default locale object. This page indexes countries to ISO currency codes and the linked pages have ISO country codes. All these bits should fulfill you requirements, barring any incidental increases in price to taxation in the users locale that you are unaware of.
Upvotes: 0