# Android letting me purchase a non-consumable product more than 1 time

**URL:** <https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684>\
**Category:** Mobile\
**Tags:** unreal-engine, Android\
**Created:** [April 22, 2021, 2:31am UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684 "2021-04-22T02:31:53Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashyankee](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ashyankee/32/88719_2.png) [@Ashyankee](https://forums.unrealengine.com/u/Ashyankee)\
**Post date:** [April 22, 2021, 2:31am UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/1 "2021-04-22T02:31:53Z")

</div>

I’m using the following setup to make an in app purchase.

 ![Help1](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/e/1e0986574c4731ff2d4dc148e3aaf51dff142a28.png)

I’m able to make the purchase in my app. I have a button setup. When i hit the button, google shows a test card and I’m able to make the purchase - No problem!

However, after making the purchase when i hit the button again, Android does not say user already owns the item. I’m able to make another transaction. I’m setting the “is consumable” boolean value to false.

How do I make/setup a non-consumable purchase that goes through only once.

I’m on 4.26.1

Any thoughts on this behavior?

---

<div class="post-metadata">

**Author:** ![Ashyankee](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ashyankee/32/88719_2.png) [@Ashyankee](https://forums.unrealengine.com/u/Ashyankee)\
**Post date:** [April 23, 2021, 3:58am UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/2 "2021-04-23T03:58:20Z")

</div>

I dont want to do it more than once though. It is letting me do it more than once. I want it to say player already owns this item.

---

<div class="post-metadata">

**Author:** ![Ashyankee](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ashyankee/32/88719_2.png) [@Ashyankee](https://forums.unrealengine.com/u/Ashyankee)\
**Post date:** [April 23, 2021, 6:49am UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/3 "2021-04-23T06:49:32Z")

</div>

I fixed this finally. Problem lies within the engine itself. According to Google, all purchases need to be “acknowledged” after the successful purchase event. I checked the GooglePlayStoreHelper.java file at Engine → Plugins → Online → Android → OnlineSubsytemGooglePlay → Source → Java → BillingApiV2 → com → EpicGames → ue4 → GooglePlayStoreHelper.java.

Check the OnPurchaseResult method. There is no code for acknowledgement. In fact without acknowledgement, Google play will refund the purchase within a week. So make sure you add this code before the line that says…

> nativePurchaseComplete(BillingClient.BillingResponseCode.OK, sku, f\_purchase.getPurchaseToken(), receipt, f\_purchase.getSignature());

This is the line that says purchase is a success. It makes sense to acknowledge the purchase before this line.

Add these lines.

> //Ashy Custom Code  
> AcknowledgePurchaseParams acknowledgePurchaseParams = AcknowledgePurchaseParams.newBuilder().setPurchaseToken(f\_purchase.getPurchaseToken()).build();
> 
> ```
> AcknowledgePurchaseResponseListener acknowledgePurchaseResponseListener = new AcknowledgePurchaseResponseListener() {
> @Override
> public void onAcknowledgePurchaseResponse(BillingResult billingResult) {             
> //getMessage("Purchase acknowledged");               
> }
> };
> 
> mBillingClient.acknowledgePurchase(acknowledgePurchaseParams,acknowledgePurchaseResponseListener);
> 
> ```
> 
> //End of Ashy Custom Code

Purchase is acknowledged and Google is showing an error saying you already own this item when i attempt the purchase again.

I hope Epic fixes this soon. Purchases getting refunded after a week could spell disaster for some people.

---

<div class="post-metadata">

**Author:** ![StAnger](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StAnger](https://forums.unrealengine.com/u/StAnger)\
**Post date:** [July 12, 2021, 7:31pm UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/4 "2021-07-12T19:31:11Z")

</div>

Hello, thank you very much for posting the solution, it just works. However, I am still unable to check whether the user owns an IAP. In one of your replies under another post you’ve mentioned that you’ve fixed this problem as well. Is there any chance you could post the solution? I’ve been trying to do this myself with no success… Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Arturogalaxy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arturogalaxy](https://forums.unrealengine.com/u/Arturogalaxy)\
**Post date:** [July 22, 2021, 2:02am UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/5 "2021-07-22T02:02:30Z")

</div>

to Stanger:  
I am not a good programmer so take what I say with a grain of salt; but I do it this whay, is a variation from this old post:

> **[In app purchases for Android with Unreal Engine 4.16 and Blueprints](https://apolofer.wordpress.com/2018/01/23/in-app-purchases-for-android-with-unreal-engine-4-16-and-blueprints/)**
>
> You know, once you’ve almost finished a nice little game with such amazing engine as Unreal Engine, you have to deal with all the nasty and unconfortable details of publishing and monetizing …

so in GooglePlayStoreHelper.java I modify QueryInAppPurchases()  
to show in the blueprint node readInAppPurchaseInformation2  
offer id string if that product is Owned. I will include screen captures. I selected the text in the captures by error thats not the only lines that changes. in the blueprint capture just use v2 node;  
and offer id string If im not wrong.

 ![firstC](https://d3kjluh73b9h9o.cloudfront.net/original/3X/4/a/4a569a5b44ea3bc813d8f471981919393c78c515.jpeg)

 ![second](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/6/863f6be147139739da07b610cf11efb3e79d87bb.jpeg)

 ![third](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/6/c6e33db6b1d1b95b7dbf18900b15b24cb9251fda.jpeg)

 ![online3](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/8/e8ae8490d765fb1eb844468a44a2e28e53763b51.png)

---

<div class="post-metadata">

**Author:** ![Arturogalaxy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arturogalaxy](https://forums.unrealengine.com/u/Arturogalaxy)\
**Post date:** [July 22, 2021, 2:16am UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/6 "2021-07-22T02:16:52Z")

</div>

In my case your solution works but only if I skip the consumePurchase function in that same file, for example leaving the function empty, of removing the two lines in both .cpp files that use that function (onlinePurchaseGooglePlay.cpp and/or OnlineStoreInterfaceGooglePlay.cpp with source compiled engine obiously) I am launching to android. (and for sure there are better ways to do it)

---

<div class="post-metadata">

**Author:** ![StAnger](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StAnger](https://forums.unrealengine.com/u/StAnger)\
**Post date:** [July 22, 2021, 4:14pm UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/7 "2021-07-22T16:14:56Z")

</div>

Thank you, you’re a live saver! Your solution works, and since you were able to find it I wouldn’t say you’re a bad programmer 😉 I can’t believe I didn’t try to modify this function, I’ve modified literally every other function in this file…

---

<div class="post-metadata">

**Author:** ![ldragosl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ldragosl](https://forums.unrealengine.com/u/ldragosl)\
**Post date:** [September 21, 2021, 11:35pm UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/8 "2021-09-21T23:35:41Z")

</div>

If you do that, you will most likely no longer be able to create consumable items. Basically this would solve a problem but create another. I think that if you add the aknowledge purchase node to the java library like Ashyankee said, and removed finalizePurchase() function from your code(assuming that you make the purchase in CPP), both would work. I have not tested this (yet) but i belive that this is the best way to do it.

Edit: For clarifications, if you look at the onlinesubsystemgoogleplay code, finalizePurchase() consumes the purchase instead of acknowledging it.

---

<div class="post-metadata">

**Author:** ![Ashyankee](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ashyankee/32/88719_2.png) [@Ashyankee](https://forums.unrealengine.com/u/Ashyankee)\
**Post date:** [October 4, 2021, 9:32pm UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/9 "2021-10-04T21:32:20Z")

</div>

I’ve raised a feature request for this

> [@\[FEATURE REQUEST\] Google Payment API fixes for acknowledging a purchase](https://forums.unrealengine.com/t/feature-request-google-payment-api-fixes-for-acknowledging-a-purchase/254121):
>
> Currently, when making a purchase, UE4 does not acknowledge the purchase. Recently, google announced that all purchases that are not acknowledged would be refunded in 3 days. This is a pitfall for developers who only rely on the blueprint purchase node. Please add an acknowledge node for android purchases.

---

<div class="post-metadata">

**Author:** ![Ashyankee](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ashyankee/32/88719_2.png) [@Ashyankee](https://forums.unrealengine.com/u/Ashyankee)\
**Post date:** [October 4, 2021, 9:33pm UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/10 "2021-10-04T21:33:18Z")

</div>

Not sure if they’ll fix it. I’m surprised they haven’t noticed it yet. Is there no one out there making android games with UE4 and offering in app purchases?

---

<div class="post-metadata">

**Author:** ![PragmaticSystematic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pragmaticsystematic/32/88709_2.png) [@PragmaticSystematic](https://forums.unrealengine.com/u/PragmaticSystematic)\
**Post date:** [October 26, 2021, 1:51pm UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/11 "2021-10-26T13:51:35Z")

</div>

This seems like a major oversight and it’s weird that Unreal offers IAP functionality at all without this important feature.

If it’s impossible to check whether or not a user already purchased an IAP, then it’s impossible to carry over his purchases if he installs the app on other devices. Or just resets his device.

@Arturogalaxy It would be very helpful if you could provide the modified version of your `GooglePlayStoreHelper.java` instead of screenshots. This way it will be easier to understand what you did and easier to add it to our own `GooglePlayStoreHelper.java` using Diff.

---

<div class="post-metadata">

**Author:** ![Arturogalaxy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arturogalaxy](https://forums.unrealengine.com/u/Arturogalaxy)\
**Post date:** [November 3, 2021, 3:44pm UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/12 "2021-11-03T15:44:36Z")

</div>

Here is my modified version of GooglePlayStoreHelper.java. With this the Read in App Purchase Information V2 returns [Owned] in the offer id information if the IAP has already been purchased.  
Tested in UE 4.26

[GooglePlayStoreHelper.java](https://forums.unrealengine.com/uploads/short-url/1tSfyLdphR8NJQhj5JMZV5HYAil.java) (28.7 KB)

---

<div class="post-metadata">

**Author:** ![PragmaticSystematic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pragmaticsystematic/32/88709_2.png) [@PragmaticSystematic](https://forums.unrealengine.com/u/PragmaticSystematic)\
**Post date:** [November 3, 2021, 5:23pm UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/13 "2021-11-03T17:23:28Z")

</div>

Thank you for attaching the file!

---

<div class="post-metadata">

**Author:** ![Beastman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Beastman](https://forums.unrealengine.com/u/Beastman)\
**Post date:** [November 19, 2021, 12:08am UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/14 "2021-11-19T00:08:21Z")

</div>

> [@Ashyankee](#):
>
> Not sure if they’ll fix it. I’m surprised they haven’t noticed it yet. Is there no one out there making android games with UE4 and offering in app purchases?

I have been struggling all year trying to keep my app maintained under these circumstances, it’s very frustrating. Thanks to those in this thread sharing solutions, it is a godsend.

---

<div class="post-metadata">

**Author:** ![Bear\_Investor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bear\_Investor](https://forums.unrealengine.com/u/Bear_Investor)\
**Post date:** [May 15, 2025, 6:26am UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/15 "2025-05-15T06:26:59Z")

</div>

Hello.  
I have the same issue in unreal engine 5.4, where I can buy non-consumable IAP multiple times.  
When i request how many IAP have I purchased via nodes “Query for Owned In-App Products” or “Restore Owned In-App Products” it always return empty array.

I tried edit GooglePlayStoreHelper.java as Ashyankee did, but his version of GooglePlayStoreHelper.java have different syntaxes, so I dont know exactly what to edit.

Can someone solved this issue in UE 5.4?

---

<div class="post-metadata">

**Author:** ![Readhunterbd1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Readhunterbd1](https://forums.unrealengine.com/u/Readhunterbd1)\
**Post date:** [May 22, 2025, 8:37am UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/16 "2025-05-22T08:37:58Z")

</div>

you got solution

---

<div class="post-metadata">

**Author:** ![Rush\_At\_Games](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rush_at_games/32/969833_2.png) [@Rush\_At\_Games](https://forums.unrealengine.com/u/Rush_At_Games)\
**Post date:** [June 6, 2025, 6:23am UTC](https://forums.unrealengine.com/t/android-letting-me-purchase-a-non-consumable-product-more-than-1-time/225684/17 "2025-06-06T06:23:02Z")

</div>

Hello!

I’ve the fix available for this problem  
Refer [In-App Purchases. How to restore IAP in UE 5.4 - #3 by Rush\_At\_Games](https://forums.unrealengine.com/t/in-app-purchases-how-to-restore-iap-in-ue-5-4/2517636/3)

Have fun!  
Rush At Games
