- Home /
Duplicate Question
Android in-app billing?
Hello, I have some questions about the Android in-app billing.
When the user buys some kind of extension like a yellow hat, will it then return as a true or false value?
If it is a value, will it then be saved on Google Play?
Will the users be able to uninstall the application and install it again, without loosing their yellow hat? ;)
Thanks, Andreas
you simply use Prime31 or one of the other excellent solutions availavle in the asset store, search here for many questions on this
btw. google has actually quite detailed docs on how their billing system works:
http://developer.android.com/google/play/billing/billing_overview.html
That's not really something Unity specific. You should read up on the different product types because there are managed and unmanaged products.
Bunnster, I'm pretty sure they are ALL managed nowadays. You can have either "normal, managed" items. (Or subscriptions, almost irrelevant in games.)
one point for new programmers ... from that doco ... "If there are any consumable in-app products, consume the items by calling consumePurchase. This step is necessary because the application might have completed the purchase order for the consumable item, but stopped or got disconnected before the application had the chance to send a consumption request."... in fact just don't bother :-) most consumables in games ("I bought some bullets!") you just use up, if incredibly you lose and buy a new phone at that split second or something ... whatever, it's not banking.
Yes, if using API version3 they are all managed. Consumables are also managed in version 3. The problem is if the users discover that you have been lazy on the consum-request-checking they will start abusing it. For example by start a consumption and quickly exit the game at the same time. Or others try to block the outgoing request.
right -- an excellent point -- you have to check receipts at purchase for sure, just like at apple you check on your own stateful server that the receipt checking is only, err, checked once (heh!)
What I meant is .. let's see their doco ...
"Subsequently, when the user starts .. your application .. you should check if the user owns any outstanding consumable in-app products ... This step is necessary because the application might have completed the purchase order for the consumable item, but ... [hit a cosmic ray or whatever] ..before the application had the chance to send a consumption request."
what I meant was, nobody bothers doing that, who cares :)