Google Play IAPs not restoring: Error. You already own this item

Hello,

I have implemented unity’s codeless IAP into my android project by following all the steps in the documentation.

However, after successfully purchasing a non-consumable and then reinstalling the app on my test device, the in-app purchases are not restored. Then, when I tap on one of the previously purchased non-consumable IAPs, this error message from Google Play appears:

I have already tried manually checking for receipts from the product ID, by calling the following function every time I open the in-game store page, but it doesn’t work:

IStoreController m_StoreController;

public void CheckIfPurchasedIAPs()
    {
        if (m_StoreController != null)
        {
            // Fetch the currency Product reference from Unity Purchasing
            Product product_1= m_StoreController.products.WithID("id_p1");

            //check if the purchase was made, but is not restored in the game
            if (product_1 != null && product_1.hasReceipt && !bought_product_1)
            {
                //code for rewarding the non-consumable again
            }
        }
    }

Any ideas why Unity’s IAP is not automatically recognizing the purchases made in the past and why manually checking for receipts is not working?

EDIT:
Here is the android logcat information at the point where I click on the already purchased non-consumable. It seems to just fail without giving any reason.

@Toastbyte Have you implemented an IAP Listener? This would be required to catch the restore events. However, I would not recommend Codeless at this time, it does not support receipt validation nor Google deferred purchases. Instead, I would recommend scripted IAP and perhaps start with the Sample IAP Project v2 here Sample IAP Project

Thank you for your reply.
I am using just codeless IAP buttons at the moment. Isn’t it sufficient?
Would I need to add an IAP Listener on top to restore Google Play purchases? Before I start rewriting my whole project to use Scripted IAP, I would like to find a quick fix to at least make this work for now.

Yes, you would need to add the IAP Listener (menu Window/Unity IAP/Create IAP Listener) to handle all events during IAP initialization, not just restore. But without receipt validation, your IAP purchases are open to hacking. And without support for Google deferred purchases, you’ll miss out on potential purchases by users who want to use this payment type. This is where the user can make a purchase in-game, but has 3 days to pay for it at a Google-approved physical location. With Codeless, the user would be awarded the product immediately, before they actually pay. We plan to address these issues with Codeless IAP in Q1-Q2 of next year. https://docs.unity3d.com/Manual/UnityIAPCodelessIAP.html

Thank you for your help and making this clear. Looking forward to the coming updates in codeless IAP.