# Upgrading to IAP SDK V21 from Unity

### Updating library files to support Android OS from v19 <a href="#upgradingtoiapsdkv21fromunity-updatinglibraryfilestosupportandroidosfromv19" id="upgradingtoiapsdkv21fromunity-updatinglibraryfilestosupportandroidosfromv19"></a>

\
However, if only the library files are replaced, new functions provided in IAP SDK v2, such as multiple purchases and subscriptions, may be unavailable.

#### Delete the v19 library files. <a href="#upgradingtoiapsdkv21fromunity-deletethev19libraryfiles." id="upgradingtoiapsdkv21fromunity-deletethev19libraryfiles."></a>

<br>

| **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>                                  |

<br>

#### Remove elements from AndroidManifest.xml <a href="#upgradingtoiapsdkv21fromunity-removeelementsfromandroidmanifest.xml" id="upgradingtoiapsdkv21fromunity-removeelementsfromandroidmanifest.xml"></a>

Assets > Plugins > Android > AndroidManifest.xml\
Remove ProxyActivity and iap\_version metadata.

```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>

```

#### [Add the v21 library files. ](https://github.com/ONE-store/unity_plugins/tree/archive) <a href="#upgradingtoiapsdkv21fromunity-addthev21libraryfiles." id="upgradingtoiapsdkv21fromunity-addthev21libraryfiles."></a>

Add the library files to the folder below.

| **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>

***

### Upgrade to use the new features of IAP SDK v21 <a href="#upgradingtoiapsdkv21fromunity-upgradetousethenewfeaturesofiapsdkv21" id="upgradingtoiapsdkv21fromunity-upgradetousethenewfeaturesofiapsdkv21"></a>

<br>

#### Delete the files added from v19 ".unitypackage" <a href="#upgradingtoiapsdkv21fromunity-deletethefilesaddedfromv19-.unitypackage" id="upgradingtoiapsdkv21fromunity-deletethefilesaddedfromv19-.unitypackage"></a>

<br>

| **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>                                                                                                                            |

<br>

#### Remove elements from AndroidManifest.xml <a href="#upgradingtoiapsdkv21fromunity-removeelementsfromandroidmanifest.xml.1" id="upgradingtoiapsdkv21fromunity-removeelementsfromandroidmanifest.xml.1"></a>

Assets > Plugins > Android > AndroidManifest.xml\
Remove ProxyActivity and iap\_version metadata.

```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>

```

#### Remove GameObject <a href="#upgradingtoiapsdkv21fromunity-removegameobject" id="upgradingtoiapsdkv21fromunity-removegameobject"></a>

Remove the GaaIapCallbackManager GameObject.\
In Unity Plugin with v21 applied, you no longer need to manually add GameObjects.\
\
If you have done all of the above, you are ready to apply the IAP SDK v21.\
Now, you can apply by referring to the guide for [Using ONE store IAP from Unity.](/dev/eng/tools/billing/v21/unity.md)

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


---

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