docs.unity3d.com
    Show / Hide Table of Contents

    IAP Button

    IAP Button is a way to purchase or restore products without writing code.

    Adding IAP Button to the Scene

    To add an IAP Button to your Scene, in the Unity Editor, select Window > Unity IAP > Create IAP Button.

    Creating a Codeless **IAP Button** in the Unity Editor

    Restore Button

    Some app stores, including iTunes, require apps to have a Restore button. Codeless IAP provides an easy way to implement a restore button in your app.

    To add a Restore button:

    1. Add an IAP Button to your Scene (Window > Unity IAP > Create IAP Button).
    2. With your IAP Button selected, locate its IAP Button (Script) component in the Inspector, then select Restore from the Button Type drop-down menu (most of the component's other fields will disappear from the Inspector view). Modifying an IAP Button to restore purchases

    When a user selects this button at run time, the button calls the purchase restoration API for the current store. This functionality works on the iOS App Store, the Mac App Store and the Windows Store. You may want to hide the Restore button on other platforms.

    If the restore succeeds, Unity IAP invokes the On Purchase Complete (Product) function on the IAP Button associated with that Product.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023