Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

[Solved] Android auto-restore vs normal purchase?

Discussion in 'Unity IAP' started by MochiBits, Sep 20, 2016.

Thread Status:
Not open for further replies.
  1. MochiBits

    MochiBits

    Joined:
    Mar 11, 2014
    Posts:
    30
    Is there any way to determine in ProcessPurchase whether a transaction is from an auto-restore or a normal purchase?
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    Hi @MochiBits,

    We don't have a built-in way to do this. One thing to note is that for auto-restore, ProcessPurchase is called immediately after OnInitialized, so one option to get the behavior you are looking for might be to check if the time between OnInitialized and ProcessPurchase is < 0.1 seconds. If it is, then it is highly likely that it is an auto-restored purchase.
     
    Firemaw likes this.
Thread Status:
Not open for further replies.