Android Consumable Purchase

Hello everyone,

I have been a little confused with creating a consumable item on Android.

Am i correct in thinking that its when you…

return PurchaseProcessingResult.Complete;

That an item becomes unconsumable?

So to make an item consumable you don’t return that it has completed?

Thanks

No, you should always return Complete. As the name implies, a consumable product (like 50 Gold Coins) can be purchased any number of times. What problem are you trying to solve?

I was attempting to make an “Ads Removal” purchase consumable so it could be tested with different scenarios using the same account.

Its simple with iOS but been having issues with Android.

Yes, testing non-consumables can be a bit tricky because your test users can only buy them once. That is why I typically configure multiple test users myself using separate email accounts that you create, and also create multiple similar non-consumable test products.

1 Like

Thanks, thats what I ended up doing, was just hoping for an easier way. :sunglasses:

Can these scenarios be tested easier in Editor? For example, is there a way to reset the state of a non-consumable in the editor? Seems like this would be controllable since it does not rely on the iOS or Android platform stores?

I setup a non-consumable on the IAP catalog and I’m testing the logic of the purchase via Editor. I bought the non-consumable and now it does not appear in the store. Is there a way to reset the state of the user in the editor?

It’s a fake store in the editor, so it’s expected behavior that the non-consumable didn’t appear in the editor store. You don’t need to reset the state of the user because IAP doesn’t save the state in the editor.

I’m sorry I’m still not getting it - if we set up a non-consumable item in the catalog, we can only test purchasing it in the editor once? And then we cannot have the item appear again in the store? Isn’t there a way to reset the fake store so that my user state is such that I have not purchased the non-consumable yet? There should be some way to test it multiple times?

You can test purchases multiple times in editor as it’s a fake store.

You don’t test purchases in the editor, it doesn’t connect to any store. To test IAP you are required to deploy to a device. But yes, you can only test a non-consumable once. Just create several test products, and/or use multiple test accounts. I do both. Ensure you make your tests worthwhile! Capture the logs each time.