2

I am making the planifiacion of a game for android and some research. But i get stuck when i have to deal with the Virtual Currency (actually i dont know if this is what i need).

The user need to be able to purchase some virtual currency (in my case beans) and with those beans purchase upgrades or whatever he wants or needs.

I see that Facebook supports this right away with his API, but Google Play (altough they dont explain how to do it) appears to not support this functionallity.

how do i accomplish this with the Google Play API?

regards!

Rothariger
  • 293
  • 3
  • 22

1 Answers1

7

What you are looking for is actually covered by the standard Android In-App Billing APIs, rather than Google Play Games specifically. A virtual currency is a type of 'Consumable In-App Purchase'. You can find out more information on these types of purchases by going to the official documentation here.

Sam Stern
  • 24,624
  • 13
  • 93
  • 124
  • yeap i already see that, but suppose that i have i dont know 20 diamonds and the user uses only 10, how do i do that? – Rothariger Oct 03 '14 at 18:42
  • 2
    When using consumables you should mark them as "consumed" the instant that the user has access to the diamonds. Then you do accounting like that inside your application. So you tell Google that the user "consumed" the purchase by adding 20 to his/her diamond count, then it is your job from there to count how many they use and determine when they need to buy more. – Sam Stern Oct 03 '14 at 19:06
  • ok thanks, but as google talked about "virtual currency" i tought that maybe they managed that. – Rothariger Oct 06 '14 at 12:48
  • @Rothariger no but I agree that would be nice. I will look into putting together a good virtual currency sample application to avoid confusion like this in the future. If your issue is solved for now, please mark this answer as correct for the benefit of future visitors. – Sam Stern Oct 10 '14 at 18:42