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

  <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p>The ONE Store IAP SDK repository will be migrated to <strong>Maven Central starting April 1, 2026</strong>.</p><p>For more details, please refer to the <a href="https://dev.onestore.net/devpoc/support/news/noticeView.omp?noticeId=33714">Notice on Migration of ONE store IAP SDK Repository</a></p></div>

* Add the ONE Store billing library dependency to the project’s top-level `build.gradle` file.

  ```gradle
  allprojects {
      repositories {
          ...
          mavenCentral() 
      }
  }
  ```

* Add ONE store payment library dependencies to the app's `build.gradle` file.

  ```gradle

  dependencies {
  def onestore_iap_version = "21.04.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](https://onestore-dev.gitbook.io/dev/eng/tools/billing/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](https://onestore-dev.gitbook.io/dev/eng/tools/billing/v21/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](https://onestore-dev.gitbook.io/dev/eng/tools/billing/old-version/v19/one-store-iap-upgrade-guide/one-store-iap-sdk-upgrade-guide) to edit changes.&#x20;
