---
title: "simulatesAskToBuyInSandbox(_:)"
framework: storekit
role: symbol
role_heading: Type Method
path: "storekit/product/purchaseoption/simulatesasktobuyinsandbox(_:)"
---

# simulatesAskToBuyInSandbox(_:)

Simulates an Ask to Buy scenario when testing your app in the sandbox environment.

## Declaration

```swift
static func simulatesAskToBuyInSandbox(_ simulateAskToBuy: Bool) -> Product.PurchaseOption
```

## Parameters

- `simulateAskToBuy`: Set to true to simulate a child’s account asking permission to make a purchase.

## Return Value

Return Value An instance of Product.PurchaseOption to use in purchase(options:).

## Discussion

Discussion For information about testing Ask to Buy scenarios, see Testing at all stages of development with Xcode and the sandbox. For information about purchases made using Ask to Buy, see Approve what kids buy with Ask to Buy.
