Search Unity

Official Unity IAP FAQs

Discussion in 'Unity IAP' started by nicholasr, Feb 25, 2016.

Thread Status:
Not open for further replies.
  1. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @emperor1412,

    I think the issue may be that you are calling ConfirmPendingPurchase from within ProcessPurchase. That isn't the intended way to handle that situation, so it may result in unexpected behavior such as what you are seeing.

    If you are doing validation on your server, you should return PurchaseProcessingResult.Pending in ProcessPurchase and then after the server has validated the purchase, you should call ConfirmPendingPurchase. But this should not happen in the same method.
     
  2. keomanla

    keomanla

    Joined:
    Jan 30, 2012
    Posts:
    26

    @ap-unity , I did exactly what you think it should be, I copy and paste by mistake that missed the last 2 lines which return PurchaseProcessingResult.Pending.

    The call ConfirmPendingPurchase in ProcessPurchase is actually inside a lamda which will be called when the verification request to server is done, so the return at the end of ProcessPurchase will always come before the ConfirmPendingPurchase call inside the lamda.

    Here is the post again, anyway the bug still there, there is another thread where people also talk about this bug:

    https://forum.unity3d.com/threads/unity-iap-android-test-purchased-not-being-consumed.382236/

     
    Last edited: Dec 22, 2016
  3. nicholasr

    nicholasr

    Joined:
    Aug 15, 2015
    Posts:
    183
    Closing this thread from general posts, to encourage usage of new threads per-issue.
     
Thread Status:
Not open for further replies.