Android Resore Purchase

StAnger
Thu, 15 Jul 2021 21:41:33 +0000
Mobile

In my game I have a single IAP that unlocks the full version of the game. The purchase itself works, all the information (price, currency, name, etc.) is displayed correctly. I was also able to make it non-consumable thanks to this post:

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

I’m using the following setup to make an in app purchase. [Help1] 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 throug…

The only problem I have is that I am not able to check in any way whether the user already owns this IAP. I am aware that Query for owned Purchases and Restore in-app Purchases2 do not work, and I gave up on fixing either after a few days of trying (most changes I make just crash the app on launch).

If the user attempts to purchase an item he already owns, this window pops up:

So I figured that I would be able to get this information from the purchase itself.
in Engine → Plugins → Online → Android → OnlineSubsytemGooglePlay → Source → Java → BillingApiV2 → com → EpicGames → ue4 → GooglePlayStoreHelper.java there is even a response code for this case, BillingResponseCode.ITEM_ALREADY_OWNED. So, whenever there is a call to nativePurchaseComplete() I’m checking for this response code and calling nativePurchaseComplete() as if the purchase was successful. However, the blueprint node still returns Failure with an empty receipts structure.

TLDR
If someone knows how to check for owned IAPs, please help me. I am losing my mind.
If someone knows how to debug these java plugins (send any info from GooglePlayStoreHelper.java in any form, anywhere) that would also help a lot. Currently I am not able to debug it because the only time this file is actually used is when I upload my app to a closed test track AND it gets REVIEWED, so each update takes a while…

4 posts - 1 participant