diff --git a/README.md b/README.md index 80fd21c..0be8ecf 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ Chargebee Android (Legacy) ============= > [!NOTE] -> #### Updates for Billing Library 5 -> - SDK Version 2.0: This version includes Google Billing Library 6.2.1 but still uses Google Billing Library 5.0 APIs to fetch product information from the Google Play Console and make purchases. If you’re integrating Chargebee’s SDK for the first time, then use this version, and if you’re migrating from the older version of SDK to this version, follow the migration steps in this [document](https://www.chargebee.com/docs/2.0/mobile-playstore-billing-library-5.html). -> - SDK Version 1.2.2: This [version](https://github.com/chargebee/chargebee-android/tree/1.x.x) includes Billing Library 6.2.1 but still uses Billing Library 4.0 APIs to fetch product information from the Google Play Console and make purchases. This will enable you to list or update your Android app on the store without any warnings from Google and give you enough time to migrate to version 2.0. +> #### Updates for Billing Library 5 and above +> - SDK Version 2.0: This version includes Google Billing Library 7.1.1 but still uses Google Billing Library 5.0 APIs to fetch product information from the Google Play Console and make purchases. If you’re integrating Chargebee’s SDK for the first time, then use this version, and if you’re migrating from the older version of SDK to this version, follow the migration steps in this [document](https://www.chargebee.com/docs/2.0/mobile-playstore-billing-library-5.html). +> - SDK Version 1.2.4: This [version](https://github.com/chargebee/chargebee-android/tree/1.x.x) includes Billing Library 7.1.1 but still uses Billing Library 4.0 APIs to fetch product information from the Google Play Console and make purchases. This will enable you to list or update your Android app on the store without any warnings from Google and give you enough time to migrate to version 2.0. > - SDK Version 1.1.0: This and less than this version of SDKs use billing library 4.0 APIs that are deprecated by Google. Therefore, it is highly recommended that you upgrade your app and integrate it with SDK version 1.2.0 and above. @@ -499,7 +499,7 @@ Chargebee is available under the [MIT license](https://opensource.org/licenses/M To install Chargebee's Android SDK, add the following dependency to the build.gradle file. ``` - implementation 'com.chargebee:chargebee-android:1.0.25' + implementation 'com.chargebee:chargebee-android:1.2.4' ``` Example project --------------- diff --git a/chargebee/build.gradle b/chargebee/build.gradle index 62c4ae4..6a481de 100644 --- a/chargebee/build.gradle +++ b/chargebee/build.gradle @@ -8,7 +8,7 @@ android { minSdkVersion 21 targetSdkVersion 31 versionCode 1 - versionName "2.0.0-beta-4" + versionName "2.0.0-beta-5" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -41,7 +41,7 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' // Google play billing library - implementation 'com.android.billingclient:billing-ktx:6.2.1' + implementation 'com.android.billingclient:billing-ktx:7.1.1' // AssertJ testImplementation "org.assertj:assertj-core:$assertj_version" diff --git a/chargebee/src/main/java/com/chargebee/android/Chargebee.kt b/chargebee/src/main/java/com/chargebee/android/Chargebee.kt index 8fa3dc2..0644140 100644 --- a/chargebee/src/main/java/com/chargebee/android/Chargebee.kt +++ b/chargebee/src/main/java/com/chargebee/android/Chargebee.kt @@ -35,7 +35,7 @@ object Chargebee { var appName: String = "Chargebee" var environment: String = "cb_android_sdk" const val platform: String = "Android" - const val sdkVersion: String = "2.0.0-beta-4" + const val sdkVersion: String = "2.0.0-beta-5" const val limit: String = "100" private const val PLAY_STORE_SUBSCRIPTION_URL = "https://play.google.com/store/account/subscriptions" diff --git a/chargebee/src/main/java/com/chargebee/android/billingservice/BillingClientManager.kt b/chargebee/src/main/java/com/chargebee/android/billingservice/BillingClientManager.kt index b2c6d35..9b70213 100644 --- a/chargebee/src/main/java/com/chargebee/android/billingservice/BillingClientManager.kt +++ b/chargebee/src/main/java/com/chargebee/android/billingservice/BillingClientManager.kt @@ -17,6 +17,7 @@ import com.chargebee.android.models.PricingPhase import com.chargebee.android.models.PurchaseProductParams import com.chargebee.android.models.PurchaseTransaction import com.chargebee.android.models.SubscriptionOffer +import com.chargebee.android.models.PendingPurchasesParams import com.chargebee.android.network.CBReceiptResponse import com.chargebee.android.restore.CBRestorePurchaseManager import java.util.concurrent.ConcurrentLinkedQueue @@ -572,7 +573,7 @@ class BillingClientManager(context: Context) : PurchasesUpdatedListener { private fun buildBillingClient(listener: PurchasesUpdatedListener): BillingClient? { if (billingClient == null) { billingClient = mContext?.let { - BillingClient.newBuilder(it).enablePendingPurchases().setListener(listener) + BillingClient.newBuilder(it).enablePendingPurchases(PendingPurchasesParams.newBuilder().enableOneTimeProducts().build()).setListener(listener) .build() } }