I'm starting with In App Billing and I would like to sell some magazines in my app. If one user buy one magazine he can read it always. I read about consumable and non-consumable in app billing but I didn't understand how can I make a non-consumable item and how can I manage it. I have to create a consumable item in google developer console and than specify in my app with a variable that the item is non-consumable?
Thank you in advance
First, The In-app Billing Version 3 service only supports managed in-app products so make sure that you specify that the purchase type is 'Managed' when you add new items to your product list in the Developer Console.
In In-app Billing Version 3 API once an item is purchased, it is considered to be "owned" and cannot be purchased again from Google Play. So I think we can say that per default items are non-consumable.
If you want to make this item consumable you have to call the consume function just after the purchase. Calling the consume function will "free" your item and make it "available" again. (Your user will be able to purchase it as many time as he wants)
mHelper.consumeAsync(purchase, mConsumeFinishedListener);
If you don't call the consume function, your item will never be consumed and will act like a non-consumable item.
Refering the developer site for the same, would be also helpful.
http://developer.android.com/google/play/billing/api.html
Related
I want to use both one-time product(SkuType.INAPP) and subscriptions(SkuType.SUBS) on my Android application.
I'm wondering how can we implement both at once.
Setup your products i.e.One time purchase and subscriptions on your Google Play console account and refer this documentation Integrate the Google Play Billing Library into your app
This is not a complete solution. It's just to give you an idea of how you can solve your problem.
If you would like to use both INAPP and SUBS at the same time in your app you must call the Billing API twice to get two SkuDetailsLists and handle the items individually within your app.
When BillingClient is ready do this:
if (billingClient.isReady()) {
getSkuDetailsListInapp();
getSkuDetailsListSubs();
}
Handle the logic for each case. Keep two skuDetailsLists, one for SUBS items and one for INAPP items.
Then, when the user select an item to purchase/subscribe to in your app you provide the correct list to handlePurchase.
Make sure you handle the logic for both SUBS and INAPP payments within handlePurchase. You might need to consume INAPP items for example.
I need to create a new In App Purchase in the Google console. The only 2 options I see are "MANAGED PRODUCTS" and "SUBSCRIPTIONS"
Inside "Managed products" I only get 1 options of "Create managed product".
However, in Google's documentation it refers to one-time products as
"Consumable" and "Non-consumable"
Where is this set for an item?
What part of this am I missing?
We've created a few managed products, but it seems like we can only purchase them once - and we want to purchase them multiple times.
Thanks.
First of all, "Consumable" and "Non-consumable" is not a In-App billing term. They are just for explaining use cases.
From Indicate a one-time product has been consumed section,
To indicate that a one-time product has been consumed, call the consumeAsync() method
If consumeAsync() is called, it becomes buyable again, means it becomes "Consumable".
I am trying to define my In-app Products using Google Play Developer Console.
However when the Add New Product dialog pops up only two options are available, and neither is fit my "can be purchased multiple times" expectation.
One option is the Managed product, ("... Managed items that can be purchased only once per user account on Google Play...")
The second is the Subscription, ("... Subscriptions let you sell content, services or features in your app with automated, recurring billing....") Well this is more far what I would like to do.
there is no option to be able to buy an item multiple times per say. What you are looking for is a managed item but when the user uses that item you need to consume that item and then the user can purchase it again.
http://developer.android.com/google/play/billing/api.html#consume
I got my current app in test with some items to testpurchase. And I´ve done that now but I need to do further testing on those items. Is there a way to simply "restore" those purchases so that I dont get that error "You already own this item" ?
There is a way:
Once an in-app product is purchased, it is considered to be "owned".
In-app products in the "owned" state cannot be purchased from Google
Play. You must send a consumption request for the "owned" in-app
product before Google Play makes it available for purchase again.
Consuming the in-app product reverts it to the "unowned" state, and
discards the previous purchase data.
I am using in-app version 3 in my app. I want to purchase an already owned item from play store. But I saw that managed products can be purchased only once per user account and in Version 3, all in-app products are managed. What should I do?
You need to consume the in-app product within your app by sending a consumePurchase call. Afterwards the item can be purchased again. See https://developer.android.com/google/play/billing/api.html#consume for details.