IAP Button (Legacy) is obsolete. Please use IAP Button. This new button allows for more UI customization and new events such as OnProductFetched(Product)
.
IAP Button is a way to purchase or restore products without writing code.
To add an IAP Button to your Scene, in the Unity Editor, select Window > Unity IAP > Create IAP Button (Legacy).
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:
On Transactions Restored script example:
public void OnTransactionsRestored(bool success, string? error)
{
Debug.Log($"TransactionsRestored: {success} {error}");
}
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.
Unity IAP will always invoke the On Transactions Restored (Boolean, String) function on the Restore IAP Button with the result and the associated error message if the restore fails. If the restore succeeds, Unity IAP invokes the On Purchase Complete (Product) function on the IAP Button associated with that Product.