# PurchaseClient.Builder

```
public static final class PurchaseClient.Builder
```

```
java.lang.Object
    ↳ com.gaa.sdk.iap.PurchaseClient.Builder
```

[PurchaseClient](/dev/tools/billing/v21/references/classes/purchaseclient.md) 인스턴스를 만들기 위한 빌더입니다.

## Public Methods <a href="#id-c-purchaseclient.builder-publicmethods" id="id-c-purchaseclient.builder-publicmethods"></a>

***

### setBase64PublicKey <a href="#id-c-purchaseclient.builder-setbase64publickey" id="id-c-purchaseclient.builder-setbase64publickey"></a>

```
@UiThread
public PurchaseClient.Builder setBase64PublicKey(String base64PublicKey)
```

구매정보의 유효성 체크를 위해 개발자센터에서 발급된 public key 를 지정하세요.

| **Parameters:**                   |                        |
| --------------------------------- | ---------------------- |
| base64PublicKey                   | base64EncodedPublicKey |
| **Returns**                       |                        |
| <p>PurchaseClient.Builder<br></p> |                        |

### setListener <a href="#id-c-purchaseclient.builder-setlistener" id="id-c-purchaseclient.builder-setlistener"></a>

```
@UiThread
public PurchaseClient.Builder setListener([I]PurchasesUpdatedListener listener)
```

onPurchasesUpdated 이벤트를 받을 수 있게 지정하세요.

| **Parameters:**                   |                                                                                                      |
| --------------------------------- | ---------------------------------------------------------------------------------------------------- |
| listener                          | [PurchasesUpdatedListener](/dev/tools/billing/v21/references/interfaces/purchasesupdatedlistener.md) |
| **Returns:**                      |                                                                                                      |
| <p>PurchaseClient.Builder<br></p> |                                                                                                      |

### build <a href="#id-c-purchaseclient.builder-build" id="id-c-purchaseclient.builder-build"></a>

```
@UiThread
public [C]PurchaseClient build()
```

PurchaseClient 인스턴스를 생성합니다.

| **Return:**                                                                        |                                          |
| ---------------------------------------------------------------------------------- | ---------------------------------------- |
| [\[C\]PurchaseClient](/dev/tools/billing/v21/references/classes/purchaseclient.md) |                                          |
| **Throws:**                                                                        |                                          |
| java.lang.IllegalArgumentException                                                 | context or listener 가 정상적이지 않을 경우 발생합니다. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://onestore-dev.gitbook.io/dev/tools/billing/v21/references/classes/purchaseclient.builder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
