Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved IAP Restore (IOS)

Discussion in 'Unity IAP' started by pKallv, Aug 22, 2020.

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

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,120
    I am confused where exactly I should query if a non-consumable product is purchased or not. I have tested, and googled, but I am still not sure.

    I am testing:

    Code (CSharp):
    1. controller.products.WithID(productID).hasReceipt
    In:

    Code (CSharp):
    1. public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
    My idea is that if I receive "True" I will disable the purchase button and enable the Restore button if the user reinstall the app.

    Is this correct?
     
  2. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    592
    Yes, if a non-consumable product has already been purchased, then users should not be provided with a button to purchase it again.

    You should provide users with a restore button so that they can restore the products they have purchased after reinstalling the application. You should check these products in the ProcessPurchase method.
    https://docs.unity3d.com/2018.1/Documentation/Manual/UnityIAPRestoringTransactions.html
     
  3. itierney

    itierney

    Joined:
    Jan 28, 2019
    Posts:
    27
    @SamOYUnity3D

    When you add an IAP Restore button, the preferences to set a function disappear.
    Also when I look at the IAP rockets example the restore button isn't even a IAP button!

    So just to clarify:

    1. When I use an IAP_restore button do I have to write additional code to trigger a restore? (Many tutorial say you don;t)
    2. If so where do I put this code and how to I link it to the IAP button (all options disappear when you set the button type to restore!)
    3. At the moment I am just creating an IAP button and setting it to restore (no additional code). When I look at the console while running on an iPhone it prints the following but nothing happens...so iOS sign in..nothing!

    2022-11-05 19:31:46.901607+0000 PocketBuddha[67035:5564595] UnityIAP: RestorePurchase

    2022-11-05 19:31:47.922061+0000 PocketBuddha[67035:5564595] UnityIAP: PaymentQueueRestoreCompletedTransactionsFinished"
     
  4. Yannick_D

    Yannick_D

    Unity Technologies

    Joined:
    Feb 21, 2022
    Posts:
    217
    Closed since the initial problem was resolved.

    The new issue was answered in another thread
     
Thread Status:
Not open for further replies.