Search Unity

IOS IAP purchase successful, but success callback not called

Discussion in 'Unity IAP' started by outthinking01, May 28, 2019.

  1. outthinking01

    outthinking01

    Joined:
    Sep 22, 2014
    Posts:
    9
    On purchase product, store confirmation popup with buy/cancel option will come, upon clicking buy option store success/failure response will display with popup message along with "Ok" button., if even success message comes, game rewards are not adding until we click ok button..
    How we can give reward on purchase success popup without even clicking ok button., because user is killing app/sudden shutdown of device/app is in minimized state without clicking ok button & so they are loosing rewards along with their real money in the next app launch!

    How we can solve this problem?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you be specific on the steps that you followed to reproduce the issue? We are trying to track this down.
     
  3. TeemuS0

    TeemuS0

    Joined:
    Aug 30, 2019
    Posts:
    2
    Bumping this as we've ran into the same issue on Android. If the user initiates a purchase and then quickly minimizes or closes the application, the payment will have gone through but the success callback is never reached.

    Any clean way to combat this problem? Would it be possible to somehow just cancel the whole purchase process OnApplicationPause for example? Though, I'd imagine even then there's a good chance the user was already charged before the process gets shutdown...
     
  4. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    ProcessPurchase will be called after the next IAP initialization, and you should reward the user at that time.
     
  5. TeemuS0

    TeemuS0

    Joined:
    Aug 30, 2019
    Posts:
    2
    Hmm, I'm currently validating the purchase in ProcessPurchase using PlayFab's API. I guess that's where it might be getting stuck, if it should be getting to ProcessPurchase the next time IAP is initialized.
     
  6. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    Yes, please kindly check whether the ProcessPurchase be called after the next IAP initialization.