Android Resore Purchase

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:

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 → 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.

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 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…

Have you tried using queryPurchaseHistoryAsync()? According to this thread only this function actually gets data from google.

Yes, that was one of the first things I’ve tried. Using this function crashes the app :frowning:

Alright, I got the answer here.
All credit goes to Arturogalaxy and Ashyankee