# 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.](https://onestore-dev.gitbook.io/dev/eng/tools/billing/v21/unity)

<figure><img src="https://2218522982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgStyyzRzNh9x2u93ZH03%2Fuploads%2FfNNQCANAi22xcnsceU9z%2Fimage.png?alt=media&#x26;token=031863e9-5cab-4699-8325-5b2aa217674e" alt=""><figcaption></figcaption></figure>
