From 999c64be7ecf03ffd1f8a54353da9ede7a61aab1 Mon Sep 17 00:00:00 2001 From: Rohit Sharma Date: Wed, 9 Jul 2025 11:06:30 +0530 Subject: [PATCH 1/3] Upgraded billing lib to v7.1.1 --- README.md | 4 ++-- chargebee/build.gradle | 4 ++-- chargebee/src/main/java/com/chargebee/android/Chargebee.kt | 2 +- .../chargebee/android/billingservice/BillingClientManager.kt | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 80fd21c..65b9fef 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ 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. +> - 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. 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() } } From 8cbaa9123e141fb1bcca681afe8d893ec08eeb39 Mon Sep 17 00:00:00 2001 From: Rohit Sharma Date: Wed, 9 Jul 2025 12:02:25 +0530 Subject: [PATCH 2/3] README updated --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 65b9fef..e58fd57 100644 --- a/README.md +++ b/README.md @@ -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 --------------- From 3d864cb2f609ea579d75212610191e2f2dd44dc7 Mon Sep 17 00:00:00 2001 From: cb-rohitsharma <163239710+cb-rohitsharma@users.noreply.github.com> Date: Fri, 11 Jul 2025 11:00:07 +0530 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e58fd57..0be8ecf 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Chargebee Android (Legacy) ============= > [!NOTE] -> #### Updates for Billing Library 5 +> #### 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.