# Upgrading ONE store IAP to V21

### **Upgrade from v19 to v21** <a href="#upgradingonestoreiaptov21-upgradefromv19tov21" id="upgradingonestoreiaptov21-upgradefromv19tov21"></a>

#### **Change the Library** <a href="#upgradingonestoreiaptov21-changethelibrary" id="upgradingonestoreiaptov21-changethelibrary"></a>

ONE store In-App Purchase (IAP) SDK provides distribution through maven from v21.\
If you want to use the IAP library through maven, you must make the following changes:

* Delete the v19 AAR file.
  * Delete the iap\_sdk-v19.XX.XX.aar file in the libs folder of the project.
* &#x20;Add maven dependencies.
  *   Register the ONE store maven address in the project top-level _build.gradle_ file.&#x20;

      ```gradle

      allprojects {
      repositories {
      ...
      maven { url 'https://repo.onestore.net/repository/onestore-sdk-public' }
      }
      }
      ```
*
  *   Add ONE store payment library dependencies to the app's _build.gradle_ file.

      ```gradle

      dependencies {
      def onestore_iap_version = "21.00.00"
      implementation "com.onestorecorp.sdk:sdk-iap:$onestore_iap_version"
      }

      ```

#### **Change the json File** <a href="#upgradingonestoreiaptov21-changethejsonfile" id="upgradingonestoreiaptov21-changethejsonfile"></a>

ONE store has provided essential params for use in SDK from IAP SDK v19 through global-appstores.json.\
Starting from v21, we are distributing these values to maven to make them more convenient.\
To change the content, please follow the steps below:

* Delete global-appstores.json
  * Delete the global-appstores.json file in the assets folder of the project
* &#x20;Add maven dependencies
  *   Register the ONE store maven address in the project top-level's _build.gradle_ file.

      ```gradle

      allprojects {
      repositories {
      ...
          maven { url 'https://repo.onestore.net/repository/onestore-sdk-public' }
      }
      }

      ```
  *   Add ONE store payment library dependencies to the app's _build.gradle_ file.

      ```gradle

      dependencies {
      def onestore_configuration_version = "1.0.0"
      implementation "com.onestorecorp.sdk:sdk-configuration-kr:$onestore_configuration_version"
      }

      ```

#### &#x20;**Edit Deprecated Items** <a href="#upgradingonestoreiaptov21-editdeprecateditems" id="upgradingonestoreiaptov21-editdeprecateditems"></a>

The following items have been deprecated in v21 SDK.\
There is no problem using it. However, changes are required for smooth use in the future.

*   Interface

    | **name**          | **description**                                                                   |
    | ----------------- | --------------------------------------------------------------------------------- |
    | PurchasesListener | Starting from v21, please use QueryPurchasesListener instead of PurchasesListener |
*   Method

    | **class**      | **method name**             | **description**                                                                                                                                                                                                                                                                                                                                                                                                                     |
    | -------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | PurchaseClient | manageRecurringProductAsync | <p>Starting from v21, Subscription products are supported instead of Monthly auto-renewal products, and these functions are supported through the regular payment menu.<br>In the case of the subscriptions menu, monthly auto-renewal products are not supported, so reservation/cancellation must be provided before using the API.<br>Subscription products must be implemented to guide the users to the subscription menu.</p> |
    | <p><br></p>    | launchLoginFlowAsync        | <p>The authentication-related flow is separated into separate classes.<br>For details, please refer to the InApp Auth Implementation Guide</p>                                                                                                                                                                                                                                                                                      |

### **Upgrade from v17 to v21** <a href="#upgradingonestoreiaptov21-upgradefromv17tov21" id="upgradingonestoreiaptov21-upgradefromv17tov21"></a>

#### **Change the Payment Library** <a href="#upgradingonestoreiaptov21-changethepaymentlibrary" id="upgradingonestoreiaptov21-changethepaymentlibrary"></a>

Upgrading from v17 to v21 changes the library from jar to aar.\
Developers using the v17 library must upgrade from 19 to v21 through the guide and change to maven. Then, additional work (deleting meta-data) is required on the part that has changed from jar to aar distribution.

* Delete v17 jar library
  * Delete the jar file in the libs folder of the project.
*   Delete the following meta-data in AndroidManifest

    ```xml

    <meta-data android:name="iap:api_version" android:value="5"/>

    ```
* Add maven dependencies: [Note for upgrading from v19 to v21](upgrade)

#### &#x20;**Add Json File Dependencies** <a href="#upgradingonestoreiaptov21-addjsonfiledependencies" id="upgradingonestoreiaptov21-addjsonfiledependencies"></a>

From v19 and above, the json file is required for the operation of SDK. Please refer to [Upgrading from v19 to v21 > Change the json file > Add maven dependencies](upgrade) to add dependencies to the project.

#### **Edit Changes** <a href="#upgradingonestoreiaptov21-editchanges" id="upgradingonestoreiaptov21-editchanges"></a>

Please refer to the [ONE store In-App Purchase SDK upgrade guide](../old-version/v19/one-store-iap-upgrade-guide/one-store-iap-sdk-upgrade-guide) to edit changes.&#x20;
