# 13. Unity에서 IAP SDK v21로 업그레이드 하기

### **Unity 용 v21 라이브러리 파일 업데이트하기** <a href="#id-13.unity-iapsdkv21-unity-v21" id="id-13.unity-iapsdkv21-unity-v21"></a>

{% hint style="info" %}
단, 라이브러리 파일만 교체했을 경우 IAP SDK v21에서 새롭게 제공하는 복수 구&#xB9E4;***,*** 구독  등의 기능은 사용할 수 없습니다.
{% endhint %}

#### v19 라이브러리 파일 삭제하기 <a href="#id-13.unity-iapsdkv21-v19" id="id-13.unity-iapsdkv21-v19"></a>

| Assets > Plugins > Android | <ul><li>iap\_sdk-v19.00.xx.aar</li><li>iap\_adapter-v1.x.x.aar</li></ul> |
| -------------------------- | ------------------------------------------------------------------------ |
| Assets > StreamingAssets   | <ul><li>global-appstores.json</li></ul>                                  |

#### AndroidManifest.xml에서 엘리먼트 제거하기 <a href="#id-13.unity-iapsdkv21-androidmanifest.xml" id="id-13.unity-iapsdkv21-androidmanifest.xml"></a>

Assets > Plugins > Android > AndroidManifest.xml

ProxyActivity 와 iap\_version 메타 데이터 제거합니다.

```xml

<manifest>
    <application>
         <activity android:name="com.gaa.sdk.iap.ProxyActivity"
                  android:configChanges="locale|fontScale|keyboard|keyboardHidden|layoutDirection|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
                  android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>

         <meta-data android:name="iap:api_version" android:value="6"/>
        ...
    </application>
</manifest>

```

#### [Unity용 v21 라이브러리 파일](https://github.com/ONE-store/unity_plugins/tree/archive)을 추가하기  <a href="#id-13.unity-iapsdkv21-unity-v21" id="id-13.unity-iapsdkv21-unity-v21"></a>

아래의 폴더에 라이브러리 파일을 추가합니다.

| Assets > Plugins > Android | <ul><li>sdk-base-v1.0.0.aar</li><li>sdk-auth-v1.0.1.aar</li><li>sdk-iap-v21.00.00.aar</li><li>sdk-configuration-kr-v1.0.0.aar</li><li>iap-unity-adapter-v2.0.0.aar</li></ul> |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

<br>

<br>

### IAP SDK v21의 새로운 기능을 사용하기 위해 업그레이드하기 <a href="#id-13.unity-iapsdkv21-iapsdkv21" id="id-13.unity-iapsdkv21-iapsdkv21"></a>

#### v19 ".unitypackage"에서 추가되었던 파일 삭제하기 <a href="#id-13.unity-iapsdkv21-v19-.unitypackage" id="id-13.unity-iapsdkv21-v19-.unitypackage"></a>

| Assets > Plugins > Android  | <ul><li>iap\_sdk-v19.00.xx.aar</li><li>iap\_adapter-v1.x.x.aar</li></ul>                                                                                           |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Assets > Scripts > Purchase | <ul><li>GaaIapCallManager.cs</li><li>GaaIapCallbackManager.cs</li><li>GaaIapResultListener.cs</li><li>GaaIapPurchaseResponse.cs</li><li>AndroidNative.cs</li></ul> |
| Assets > StreamingAssets    | <ul><li>global-appstores.json</li></ul>                                                                                                                            |

#### AndroidManifest.xml에서 엘리먼트 제거하기 <a href="#id-13.unity-iapsdkv21-androidmanifest.xml-.1" id="id-13.unity-iapsdkv21-androidmanifest.xml-.1"></a>

Assets > Plugins > Android > AndroidManifest.xml

ProxyActivity 와 iap\_version 메타 데이터 제거합니다.

```xml

<manifest>
    <application>
         <activity android:name="com.gaa.sdk.iap.ProxyActivity"
                  android:configChanges="locale|fontScale|keyboard|keyboardHidden|layoutDirection|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
                  android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>

         <meta-data android:name="iap:api_version" android:value="6"/>
        ...
    </application>
</manifest>

```

#### GameObject 제거하기 <a href="#id-13.unity-iapsdkv21-gameobject" id="id-13.unity-iapsdkv21-gameobject"></a>

GaaIapCallbackManager 게임 오브젝트 제거합니다.\
v21이 적용된 Unity Plugin에서는 이제 GameObject를 수동으로 추가할 필요가 없습니다.

<figure><img src="/files/YB76KYyUpUymUXDogfQr" alt=""><figcaption></figcaption></figure>

위의 모든 작업을 수행하였다면 IAP SDK v21을 적용하기에 앞서 사전 준비가 완료되었습니다.

이제 12. Unity에서 원스토어 인앱결제 사용하기 가이드를 참조하여 적용하시면 됩니다.


---

# 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/unitymig.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.
