4.12.1-pre.3 on iOS: ProcessPurchase() not called anymore?

Hi,

I have just updated package from 4.12.1-pre.1 to 4.12.1-pre.3.
When testing a debug build on my iPad, I try to purchase a non consumable item (already purchased on the Apple SandBox).
I got the message from Apple “You already have purchased… do you want to restore…”.
But my ProcessPurchase() function is not called anymore…
On Xcode console, I have just “UnityIAP: Finishing transaction 2000000647617505” then nothing else.
On your Changelog, I notice this change:
Apple - Product.appleProductIsRestored will no longer be sent to ProcessPurchase since they have already been processed.

So is this the reason why my ProcessPurchase() is not called?
How can I restore the item? My RestoreTransactions() function was not called either…

It works without problem on 4.12.1-pre.1. (and don’t work with 4.12.1-pre.4).
My Unity version : 2022.3.36f1

Regards

1 Like

Hello Knbmedia,

The recent change was made to match the behaviour between all our stores where a purchase that was already processed isn’t sent to ProcessPurchase again.

In this case, the product is already filled with the receipt and transactionID. Restoring it again won’t do anything new since it was processed previously and properly retrieved from the store when IAP was launched.

Could you help us better understand your use case so we can make adjustments if needed?
Also, if your app is also on the Google Play Store, how do you handle this case differently on the Google Play Store?

Hello @Yannick_D ,
How then do you handle the fact that a user can try to purchase an already purchased IAP (non consumable) after reinstalling the game?
On Play Store, when reinstalling, the purchases are automatically restored.
But not on iOS, we don’t know about previous purchases (it’s why a “Restoring purchase” button is mandatory).
So the user can try to purchase the same item again (because he don’t remember he has already purchased it).
On 4.12.1-pre.1 and before, I get a callback from UnityIAP (ProcessPurchase() is called).
Not on 4.12.1-pre.3+ : my app wait for a callback which never happens…

I noticed too that my Restore Purchase button doesn’t work anymore.
In the m_Extensions.GetExtension().RestoreTransactions((result, error) function, I start a coroutine that waits for ProcessPurchase to finish (receipt validation) for all restored products.
But as this ProcessPurchase callback isn’t called anymore, how can I restore the products and check receipts?

This would be a showstopper for us, Restore Purchases has to work on iOS. So does the “buy again without having to pay” flow.

It seems to me that the IAP team forgot that on the Play Store the purchases are automatically restored, but not on iOS. And you can’t automatically call the “Restore Purchases” method without user intervention per Apple’s guidelines.
@Yannick_D Why was this change made and what’s the workaround?

I’ve discussed with the team and we will be reverting back this change in 4.12.1 since this is having unintended consequences.

To answer some questions on why we did this:
These purchases were already retrieved from the store when launching IAP, so restoring them wouldn’t change anything since the user already had them. In the case where they weren’t retrieved (changing to a new device), then the restore purchases would work correctly. This was meant to avoid unnecessary calls to ProcessPurchase when the purchase had already been processed previously.

1 Like