flutter_iap icon indicating copy to clipboard operation
flutter_iap copied to clipboard

FlutterIap.fetchInventory() returns empty purchases

Open buttermilktoast opened this issue 6 years ago • 5 comments

Hi there, I did see the other issue about this and it was resolved, but mine has been about a day already and it's still returning empty products. This is for Android on Google Play and I did purchase the IAP with this plugin and it worked so that was awesome!

Just trying to clarify if there is a missing set up step I needed to do to see my recently purchased IAPs... I did delete the app and reinstall it; wondering if that affects it? I do see the purchase in the Order History in my Account in the Play Store and have seen it come through in the Play console financial reports.

Any help is appreciated and thanks for making this plugin!

buttermilktoast avatar Dec 18 '18 07:12 buttermilktoast

Did you consume the purchase? If so, it will be gone from your inventory.

ened avatar Jan 14 '19 05:01 ened

Does this only show non consumable in app purchases? Sorry, I thought it was a method to show your past purchase history. For context, it's an IAP to remove ads, and I wanted to basically remove ads if I see that you already purchased it.

As a side note, I'm unable to see how I can find out if my IAP is a consumable vs. a non consumable in the Google Play developer console. I did create this app a couple years back (recently converted to Flutter) so the interface has changed quite a bit... Do you perchance know how to tell?

buttermilktoast avatar Jan 16 '19 19:01 buttermilktoast

Past purchase history may not be available to App developers, I have yet to see the APIs for that. If there are any, we will integrate it into flutter_iap. For the AD removal usecase, simply don't consume it and check if the item is in the inventory.

Google Play IAPs are always consumable.

Apple IAPs can be created consumable and non-consumable, and are thus a little less "flexible".

ened avatar Jan 17 '19 07:01 ened

Ahh ok I see, thanks. I come from the Apple world, so I'm more familiar with non-consumable vs. consumable aspect of it.

Regarding not consuming it, I can't seem to find out how to do that in the code. The way I've implemented the plugin is to just call the buy method with the id like so.

IAPResponse response = await FlutterIap.buy(removeAdsId);

Then I just check that the id is in the response and that's it. So I don't think I'm explicitly consuming it... Is there maybe another way to do the purchasing so that it's not consumed?

Thanks again for your time, it's really appreciated. Great job!

buttermilktoast avatar Jan 17 '19 08:01 buttermilktoast

@buttermilktoast the explicit consume is not available in this library, yet. The currently published version consumes all purchases immediately. @JackAppDev I will send the PR (which includes a few more changes.. protobuf, preparations for subscription logic) asap. We could release it as a 2.0.0-pre1

ened avatar Jan 17 '19 09:01 ened