Guys, when I’m buying a CONSUMABLE PRODUCT using Unity IAP on Android, the ProcessPurchase method is being called twice.
This started to happens today. It’s odd because our old builds (from June 2017) are being affected too (using an old Unity Version and old UnityIAP version). This never happened before. It only happens on Android.
The transaction id and payload are both equal. The Unity is calling the ProcessPurchase one after another.
We reproduced the issue with a sandbox purchase (android) as well this morning (again - with older app that was working fine the day before yesterday) - using
5.6.1f1 and IAP [1.11.2]
Two users reported this to us, so they are not using sandbox.
Our versions are the one reported by gilberto-lumentech.
Also it is an odd behaviour, sometimes the first purchase is correct(calls ProcessPurchase only once), but afterwards it calls always two times. We saw this buying consumables with users that already had non-consumables and with users that did not. It is pretty straight forward to occour and we traced this happening up to builds we did 3 months ago, we didn’t want to go much far than that.
In my case, It got even worst, the google play dialog bugged one time I was testing, instead of presenting the content of the IAP it presented crypted data, and after that, that item is stuck, everytime I try to buy it, it says that I already have it, although ProcessPurchase is never called for that item in my game, but I’m using sandbox.
@jamiel_mf Can you clarify? This thread is about the IAP ProcessPurchase callback being called twice for each purchase. Unity IAP requires Unity Analytics to be enabled.
Uhhh… I was basing that solely on the UCB project has an option to ‘enable analytics’ which I took to mean that it was disabled. Looks like our project DOES have analytics enabled. Is that communication with Unity perhaps the cause of the double ProcessPurchase invocation?
By the way - WHY does IAP require analytics to be turned on?
Hi, same problem here, Huawei CAM-L2 Android 6.0, LG-D802 Android 5.0.2.
I cannot reproduce the error in an emulator like BlueStacks.
Of course we validate the receipt in the backend so there is no actual double purchase, just a silent error, but still, this doesn’t happens with iOS, I think.
Hi @gilberto_lumentech Thank you for reporting this and sharing all these details. I’ve not been able to reproduce this yet. I’ve not tested on 5.6.1x yet, however.
Are the double-purchases seen in log files on the device, or via external log files / analytics?
Which “payload” are you referring to in the first post of this thread?
Is there a complete device log-file you would be comfortable sharing with us which demonstrates this issue?
FYI we use the Google Play “orderId” primarily or “purchaseToken” secondarily for the Unity IAP “transactionId”.(Sandbox purchases no longer include orderId as of early 2016, so we use whichever is available.)
Hi @helton-lumentech thank you for this information. What sort of data was shown in the dialog? Was it garbage data? Or could it be a translation / localization?
According to reports on Google’s issue tracker, this may also be happening with outside of Unity IAP, so I think this may be a Google Play issue. That would also explain why it was happening to older builds of apps. It may be helpful to have the issue reported there: