# PurchaseApp()

> Attempts to purchase the app if it is in installed in trial mode.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Windows](/engine/6000.6/script-reference/unityengine/windows.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static string PurchaseApp()
```

### Returns

| Type                                                           | Description       |
| -------------------------------------------------------------- | ----------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | Purchase 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

```csharp
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");
        }
    }
}
```
