I’m planning on integrating Unity In App Purchases in an app.
I was wondering if the ProcessPurchase callback is designed to accomodate network requests (and the engine can handle it taking up to a few seconds to complete), or should I just return PurchaseProcessingResult.Pending and arrange the purchase consumation later myself?
You should return Pending and call ConfirmPendingPurchase once the network request has succeeded.
This ‘cloud save’ scenario is what the Pending/Confirm mechanism was designed for; to ensure players never lose Consumable purchases.
Even if the player uninstalls your App whilst a Consumable purchase is in the pending state, it remains tracked on the billing provider’s servers and will be picked up again by Unity IAP on the next reinstall and generate a ProcessPurchase.
Once a Consumable purchase is confirmed it is no longer tracked by the store provider and you will get no more ProcessPurchase invocations for it which is why, when doing cloud save, you must ensure your cloud save is successful before confirming a purchase.