flutter_iap icon indicating copy to clipboard operation
flutter_iap copied to clipboard

Consumable products

Open RobertBrunhage opened this issue 6 years ago • 10 comments

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

RobertBrunhage avatar Jul 09 '18 10:07 RobertBrunhage

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

JackAppDev avatar Jul 19 '18 21:07 JackAppDev

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.

RobertBrunhage avatar Jul 25 '18 04:07 RobertBrunhage

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 avatar Jul 27 '18 20:07 JackAppDev

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

JackAppDev avatar Jul 29 '18 08:07 JackAppDev

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 :/

RobertBrunhage avatar Jul 29 '18 10:07 RobertBrunhage

I'm planning on doing subscriptions within a week

JackAppDev avatar Jul 29 '18 14:07 JackAppDev

@JackAppDev

  • Non-Consumable: New levels, unlock features
  • Consumable: Potions, health upgrade
  • Subscriptions: Repeated payments

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

ened avatar Aug 26 '18 01:08 ened

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

JackAppDev avatar Aug 26 '18 01:08 JackAppDev

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.

ened avatar Aug 26 '18 03:08 ened

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.

NotThatBowser avatar Sep 30 '18 11:09 NotThatBowser

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

RobertBrunhage avatar Jun 23 '23 17:06 RobertBrunhage