diff --git a/GodotGooglePlayBilling.gdap b/GodotGooglePlayBilling.gdap index b6fddfd..b50d3e8 100644 --- a/GodotGooglePlayBilling.gdap +++ b/GodotGooglePlayBilling.gdap @@ -5,4 +5,4 @@ binary_type="local" binary="GodotGooglePlayBilling.1.1.2.release.aar" [dependencies] -remote=["com.android.billingclient:billing:4.0.0"] +remote=["com.android.billingclient:billing:5.4.0"] diff --git a/godot-google-play-billing/build.gradle b/godot-google-play-billing/build.gradle index 8e987ea..656634b 100644 --- a/godot-google-play-billing/build.gradle +++ b/godot-google-play-billing/build.gradle @@ -6,12 +6,12 @@ ext.pluginVersionCode = 4 ext.pluginVersionName = "1.1.2" android { - compileSdkVersion 30 + compileSdkVersion 31 buildToolsVersion "30.0.3" defaultConfig { minSdkVersion 18 - targetSdkVersion 30 + targetSdkVersion 31 versionCode pluginVersionCode versionName pluginVersionName } @@ -25,6 +25,6 @@ android { dependencies { implementation "androidx.legacy:legacy-support-v4:1.0.0" - implementation 'com.android.billingclient:billing:4.0.0' + implementation 'com.android.billingclient:billing:5.2.0' compileOnly fileTree(dir: 'libs', include: ['godot-lib*.aar']) } diff --git a/godot-google-play-billing/src/main/java/org/godotengine/godot/plugin/googleplaybilling/GodotGooglePlayBilling.java b/godot-google-play-billing/src/main/java/org/godotengine/godot/plugin/googleplaybilling/GodotGooglePlayBilling.java index a519223..1baa7dd 100644 --- a/godot-google-play-billing/src/main/java/org/godotengine/godot/plugin/googleplaybilling/GodotGooglePlayBilling.java +++ b/godot-google-play-billing/src/main/java/org/godotengine/godot/plugin/googleplaybilling/GodotGooglePlayBilling.java @@ -35,6 +35,7 @@ import org.godotengine.godot.plugin.GodotPlugin; import org.godotengine.godot.plugin.SignalInfo; import org.godotengine.godot.plugin.googleplaybilling.utils.GooglePlayBillingUtils; +import org.godotengine.godot.plugin.UsedByGodot; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -91,15 +92,16 @@ public void startConnection() { public void endConnection() { billingClient.endConnection(); } - + @UsedByGodot public boolean isReady() { return this.billingClient.isReady(); } - + @UsedByGodot public int getConnectionState() { return billingClient.getConnectionState(); } + @UsedByGodot public void queryPurchases(String type) { billingClient.queryPurchasesAsync(type, new PurchasesResponseListener() { @Override @@ -118,7 +120,7 @@ public void onQueryPurchasesResponse(BillingResult billingResult, } }); } - + @UsedByGodot public void querySkuDetails(final String[] list, String type) { List skuList = Arrays.asList(list); @@ -141,7 +143,7 @@ public void onSkuDetailsResponse(BillingResult billingResult, } }); } - + @UsedByGodot public void acknowledgePurchase(final String purchaseToken) { AcknowledgePurchaseParams acknowledgePurchaseParams = AcknowledgePurchaseParams.newBuilder() @@ -159,6 +161,7 @@ public void onAcknowledgePurchaseResponse(BillingResult billingResult) { }); } + @UsedByGodot public void consumePurchase(String purchaseToken) { ConsumeParams consumeParams = ConsumeParams.newBuilder() .setPurchaseToken(purchaseToken) @@ -189,7 +192,7 @@ public void onBillingSetupFinished(BillingResult billingResult) { public void onBillingServiceDisconnected() { emitSignal("disconnected"); } - + @UsedByGodot public Dictionary confirmPriceChange(String sku) { if (!skuDetailsCache.containsKey(sku)) { Dictionary returnValue = new Dictionary(); @@ -210,12 +213,12 @@ public Dictionary confirmPriceChange(String sku) { returnValue.put("status", 0); // OK = 0 return returnValue; } - + @UsedByGodot public Dictionary purchase(String sku) { return purchaseInternal("", sku, BillingFlowParams.ProrationMode.UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY); } - + @UsedByGodot public Dictionary updateSubscription(String oldToken, String sku, int prorationMode) { return purchaseInternal(oldToken, sku, prorationMode); } @@ -258,11 +261,12 @@ private Dictionary purchaseInternal(String oldToken, String sku, int prorationMo } return returnValue; - } + } + @UsedByGodot public void setObfuscatedAccountId(String accountId) { obfuscatedAccountId = accountId; } - + @UsedByGodot public void setObfuscatedProfileId(String profileId) { obfuscatedProfileId = profileId; }