JackAppDev / flutter_iap

Flutter iap plugin
MIT License
100 stars 15 forks source link

Consumable products #20

Closed RobertBrunhage closed 1 year ago

RobertBrunhage commented 6 years ago

Tested this out because I read that it supports Consumable products. It seems to say that the second time you buy a product that I already own it, so I can't buy another. I need to make the user able to buy an item multiple times (for example a potion in a game).

response = await FlutterIap.buy('first.product.store');

That is the line I am using but for some reason. The first the I buy it. it crashes, the second time it works and crashes, the third time it says I already own this item. This is with the app in release in play store in the testing segment so I am not really getting any error messages

JackAppDev commented 6 years ago

I haven't had any issues buying something multiple times on either platform. Could you check that the item is listed as consumable?

RobertBrunhage commented 6 years ago

Sorry that I haven't answered in a while. When setting up a product in play store I can only choose it to be either a product or subscription so there is no way (that I know of) to list it as a consumable.

JackAppDev commented 6 years ago

Just checked, you're right. You would have to set it as a product. Try to get the crash log so I have an idea why it doesn't work for you.

JackAppDev commented 6 years ago

@RobertBrunhage it's set up to automatically consume purchases on Android (maybe iOS too)

RobertBrunhage commented 6 years ago

Sorry don't have it left trying to switch over to subscription instead (what I want anyway). Didn't really get any error message when I had it though because it only happened on the released version on android store (internal testing).

When will you have a subscription feature?

Sorry that I can't provide any more information :/

JackAppDev commented 6 years ago

I'm planning on doing subscriptions within a week

ened commented 6 years ago

@JackAppDev

Currently, this line here: https://github.com/JackAppDev/flutter_iap/blob/bed076f28599893d1ab6d6f501123c6303f678ea/android/src/main/java/com/jackappdev/flutteriap/FlutterIapPlugin.java#L134 will turn all non-consumable products into consumables.

Suggest we add a separate API call (consume), which takes a product identifier from the inventory.

See also https://developer.android.com/google/play/billing/api#consumetypes

JackAppDev commented 6 years ago

@ened why do you think it won't consume anything for op?

ened commented 6 years ago

Not sure what means "for op", but: Currently Android buys and consumes, effectively eliminating the Non-Consumable IAP type.

I will probably get to this (after the iOS stuff) today.

NotThatBowser commented 5 years ago

This is a pretty big problem that could do with documenting until it's working. The plugin consumes all android purchases making it impossible to do non-consumable (eg permanent unlock) purchases. I'm not sure that consuming by default would be expected behaviour either.

@ened is right in that the consume method is what's making this happen and should be done through a different method or by argument.

RobertBrunhage commented 1 year ago

Closing this as being stale and I haven't tested this in 5 years :)