From 195ef400b5e4a74c2e5a43a023dbfc1b48af89bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ritzl?= Date: Tue, 2 Jul 2024 22:33:09 +0200 Subject: [PATCH] Play Billing 6.0.0 --- extension-iap/manifests/android/build.gradle | 8 ++++++-- extension-iap/src/iap.h | 1 + extension-iap/src/java/com/defold/iap/IapGooglePlay.java | 4 +++- extension-iap/src/java/com/defold/iap/IapJNI.java | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/extension-iap/manifests/android/build.gradle b/extension-iap/manifests/android/build.gradle index 1f4aa9e..8d78fb0 100644 --- a/extension-iap/manifests/android/build.gradle +++ b/extension-iap/manifests/android/build.gradle @@ -1,3 +1,7 @@ -dependencies { - implementation 'com.android.billingclient:billing:5.0.0' +repositories { + mavenCentral() +} + +dependencies { + implementation 'com.android.billingclient:billing:6.0.0' } diff --git a/extension-iap/src/iap.h b/extension-iap/src/iap.h index 79d8155..f25da25 100644 --- a/extension-iap/src/iap.h +++ b/extension-iap/src/iap.h @@ -31,6 +31,7 @@ enum BillingResponse BILLING_RESPONSE_RESULT_ERROR = 6, BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED = 7, BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED = 8, + BILLING_RESPONSE_RESULT_NETWORK_ERROR = 9, }; enum ProviderId diff --git a/extension-iap/src/java/com/defold/iap/IapGooglePlay.java b/extension-iap/src/java/com/defold/iap/IapGooglePlay.java index 1d366b4..5837ce4 100644 --- a/extension-iap/src/java/com/defold/iap/IapGooglePlay.java +++ b/extension-iap/src/java/com/defold/iap/IapGooglePlay.java @@ -221,7 +221,6 @@ public class IapGooglePlay implements PurchasesUpdatedListener { case BillingResponseCode.OK: defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_OK; break; - case BillingResponseCode.SERVICE_TIMEOUT: case BillingResponseCode.SERVICE_UNAVAILABLE: case BillingResponseCode.SERVICE_DISCONNECTED: defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_SERVICE_UNAVAILABLE; @@ -229,6 +228,9 @@ public class IapGooglePlay implements PurchasesUpdatedListener { case BillingResponseCode.USER_CANCELED: defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_USER_CANCELED; break; + case BillingResponseCode.NETWORK_ERROR: // new in Play Billing Library 6.0.0 + defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_NETWORK_ERROR; + break; case BillingResponseCode.FEATURE_NOT_SUPPORTED: case BillingResponseCode.ERROR: default: diff --git a/extension-iap/src/java/com/defold/iap/IapJNI.java b/extension-iap/src/java/com/defold/iap/IapJNI.java index 7403083..ab073b4 100644 --- a/extension-iap/src/java/com/defold/iap/IapJNI.java +++ b/extension-iap/src/java/com/defold/iap/IapJNI.java @@ -18,6 +18,7 @@ public class IapJNI implements IListProductsListener, IPurchaseListener { public static final int BILLING_RESPONSE_RESULT_ERROR = 6; public static final int BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED = 7; public static final int BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED = 8; + public static final int BILLING_RESPONSE_RESULT_NETWORK_ERROR = 9; public IapJNI() { }