Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PurchaseApp()

Attempts to purchase the app if it is in installed in trial mode.
Read time 1 minuteLast updated 13 days ago

Definition

public static string PurchaseApp()

Returns

Type

Description

stringPurchase receipt.

Remarks

Calling this pops up a dialog for the user asking whether they want to buy the application. If the user buys the application, returns a valid purchase receipt string. Otherwise, returns an empty string.

Examples

using UnityEngine;using UnityEngine.Windows;class MyMonoBehaviour : MonoBehaviour{ string m_Receipt; void OnGUI() { if (LicenseInformation.isOnAppTrial) { if (GUI.Button(new Rect(10, 10, 100, 40), "Buy full version")) { m_Receipt = LicenseInformation.PurchaseApp(); } } else { GUI.Label(new Rect(10, 10, 100, 40), "You have full application version installed"); } }}