Search Unity

[Android] Backing out of purchase dialog doesn't trigger OnPurchaseFailed

Discussion in 'Unity IAP' started by TastyRook, Nov 5, 2018.

  1. TastyRook

    TastyRook

    Joined:
    Jul 13, 2017
    Posts:
    3
    If a user initiates a purchase and hits the back button after the purchasing dialog has popped up, the purchasing dialog goes away but neither ProcessPurchase nor OnPurchaseFailed on the IStoreListener are called. Is this expected behavior? If so, how are you supposed to know that the user has cancelled out of the purchasing flow? Currently I am locking some of the UI so that you can't leave the screen in the middle of a purchase so I need some feedback that the transaction has ended.

    This project is using Unity 2017.3.1p4
    Unity IAP version 1.21.0
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @TastyRock We will investigate. Can you also test on 1.20.1 (which is the latest version, and is more recent than 1.21.0)
     
  3. TastyRook

    TastyRook

    Joined:
    Jul 13, 2017
    Posts:
    3
    For some reason this was happening 100% of the time earlier today but after testing it again I only managed to make it happen once every 10 tries or so and only when trying to back out as soon as I had initiated the purchase. I suspect it might have to do with what stage the Android purchasing dialog is at. Earlier today the dialog was taking a long time to load for some reason, would just pop up a white box for a few seconds, and backing out of that state seems to have prevented the callback. Backing out after the dialog has fully loaded seems to work as expected. We had a few reports from users of this or something similar happening but not sure how common this specific issue is.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Good to know. Is this in an Alpha/Beta release of your game, or in Production? Store testing environments can sometimes show the behavior you are describing.
     
  5. TastyRook

    TastyRook

    Joined:
    Jul 13, 2017
    Posts:
    3
    This is in production.
     
  6. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi @TastyRook ,
    I couldn't reproduce it on my side.
    Could you please send me a full log when you can reproduce it?
    Thank you.