We are compelled currently to use Unity IAP 2.3.0 since we have a few games we do not want to migrate from Unity 2019.2.x
We updated to 2.3.0 since it contains google play billing v3, and google are now enforcing the use of this library.
The issue is that after update to 2.3.0, on some devices OnProcessPurchase is not fired for already purchased products, nor do we see the receipts for them if we inquire directly.
ProcessPurchase is not expected to be fired each time the app launches, only if Restore happens, or the product is still in Pending and the transaction has not finished. The receipts should be available though. Please show your code.
Sorry, did not mention I am talking about the first launch of the game after an install, with a user that has already purchased the items previously and reinstalled the app.
The following printouts on certain devices that do not appear -
…
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs e)
{
Debug.Log("Billing::Processing Purchase: " + e.purchasedProduct.definition.id);
Debug.Log("Billing: " + e.purchasedProduct.receipt);
Debug.Log("Billing::Transaction Id: " + e.purchasedProduct.transactionID);
…
We implement Unity IAP as part of a big publishing solution that worked for billing for a few years now, but since this update has stopped working correctly… it would be a bit difficult to share the entire solution, can you tell me what you are looking for in general?
Please describe your issue in more detail please. ProcessPurchase is not expected to trigger at each app launch. What you describe that you are “not” doing IS the only time it’s expected to trigger, except for the initial purchase. That is what a Restore is, and does not occur on each app launch. Please provide detailed/numbered steps to reproduce.
Expected:
The item I have purchased should trigger ProcessPurchase after I initialize Unity IAP. (It does so on previous versions of Unity IAP at least.)
Actual:
It does not trigger ProcessPurchase.
Unity IAP Version : 2.3.0
Unity Version : 2019.2.17
Got it! Sorry I misunderstood your “did not mention” comment. You are correct, ProcessPurchase should trigger, this is indeed a Restore. Are you able to reproduce? Please provide the device logs if so. I’ve never seen this behavior myself. And this is all on the same device? I’ve followed those steps (actually hundreds of times, with different IAP versions and different devices) and have not seen the behavior as you describe. Can you share your full purchasing script (only the file that contains the IAP callbacks)? The locked thread that you linked to was fixed in a previous version of Unity IAP, before 2.3.0 Regarding device logs, this may help https://discussions.unity.com/t/699654
Once I installed their package and implemented it, I got receipts as expected and everything worked.
Sorry I can’t share code it is part of a bigger solution and currently we just dont have the resources to create a smaller readable version for sharing.
No, you don’t want to install according to those instructions. They are outdated and can cause problems. We already include Google Billing Library v3 in IAP, you can end up with duplicate libraries and incompatibilities, and will likely have issues with future releases of IAP.
I am using it with Unity IAP 2.3.0 and as i understand there wont be any new update to the legacy pacakge… of course with newer version I won’t use it, but in this case it was the only thing that solved the issue.