Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Play Billing Library: Update from v5.2.1 to v7.0.0 #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kus04e4ek
Copy link

@kus04e4ek kus04e4ek commented Jun 12, 2024

This PR only partially supersedes them, because it doesn't change Android SDK versions, gradle versions, etc. Also doesn't change already deprecated methods in version 5.

Don't have a Google Play dev account, so can't really test, can just confirm that it compiles and doesn't produce different results when using the iap demo project without Google Play Console (GodotGooglePlayBilling's only compatible with 4.0 versions and maybe some 4.1 versions, tested with 4.0.4).

With this PR docs need to be updated (change BillingFlowParams.ProrationMode to BillingFlowParams.SubscriptionUpdateParams.ReplacementMode).

This PR also makes price_change_acknowledged never emit, API changed a lot. These changes seem too big to test without Google Play Console, so if anyone wants to salvage this PR, feel free. Can be merged as is, of course after testing, if having price_change_acknowledged is not critical.

@ivanfemia
Copy link

"At least 1 approving review is required by reviewers with write access."
What is missing to have this in the official repo? Who should give the additional review?

@kyoz
Copy link

kyoz commented Jul 17, 2024

Tested on my production games, work fine. Please release it when possible. ❤️

@owlnewworlds
Copy link

What's the state of the issue ? A lot of Godot Android devs are blocked / scared about that.
Thank you! <3

@ivanfemia
Copy link

. This is not intended to override the official plugin but just a quick temporary solution.

I created a new fork in the meantime with all the fixes
You just need to build the project with your Godot libs version.

@owlnewworlds
Copy link

. This is not intended to override the official plugin but just a quick temporary solution.

I created a new fork in the meantime with all the fixes You just need to build the project with your Godot libs version.

Thank you! Well I still have time to wait for the official lib to be fixed but I hope it will be ASAP :)

@timoschwarzer
Copy link
Collaborator

Sorry people, I'm currently loaded with work so I don't have time to get to this in the next 2 weeks at least. I'll try to review, merge and release as soon as possible though. Hope you understand ❤️

billingClient = BillingClient
.newBuilder(getActivity())
.enablePendingPurchases()
.enablePendingPurchases(pendingPurchasesParams)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enablePendingPurchases is deprecated: This method is equivalent to enablePendingPurchases(PendingPurchasesParams.newBuilder().enableOneTimeProducts().build())

@@ -63,7 +62,7 @@
import java.util.List;
import java.util.Set;

public class GodotGooglePlayBilling extends GodotPlugin implements PurchasesUpdatedListener, BillingClientStateListener, PriceChangeConfirmationListener {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PriceChangeConfirmationListener is deprecated

@@ -216,14 +213,14 @@ public Dictionary confirmPriceChange(String sku) {
@UsedByGodot
public Dictionary purchase(String sku) {
return purchaseInternal("", sku,
BillingFlowParams.ProrationMode.UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY);
BillingFlowParams.SubscriptionUpdateParams.ReplacementMode.UNKNOWN_REPLACEMENT_MODE);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ProrationMode is deprecated: use SubscriptionUpdateParams.ReplacementMode instead

Comment on lines +219 to +220
public Dictionary updateSubscription(String oldToken, String sku, int replacementMode) {
return purchaseInternal(oldToken, sku, replacementMode);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comment above

}

private Dictionary purchaseInternal(String oldToken, String sku, int prorationMode) {
private Dictionary purchaseInternal(String oldToken, String sku, int replacementMode) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comment above

@@ -241,11 +238,11 @@ private Dictionary purchaseInternal(String oldToken, String sku, int prorationMo
if (!obfuscatedProfileId.isEmpty()) {
purchaseParamsBuilder.setObfuscatedProfileId(obfuscatedProfileId);
}
if (!oldToken.isEmpty() && prorationMode != BillingFlowParams.ProrationMode.UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY) {
if (!oldToken.isEmpty() && replacementMode != BillingFlowParams.SubscriptionUpdateParams.ReplacementMode.UNKNOWN_REPLACEMENT_MODE) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comment above

Comment on lines -207 to -210
PriceChangeFlowParams priceChangeFlowParams =
PriceChangeFlowParams.newBuilder().setSkuDetails(skuDetails).build();

billingClient.launchPriceChangeConfirmationFlow(getActivity(), priceChangeFlowParams, this);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PriceChangeFlowParams is deprecated

BillingFlowParams.SubscriptionUpdateParams updateParams =
BillingFlowParams.SubscriptionUpdateParams.newBuilder()
.setOldSkuPurchaseToken(oldToken)
.setReplaceSkusProrationMode(prorationMode)
.setOldPurchaseToken(oldToken)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From here: Removed BillingFlowParams.SubscriptionUpdateParams.Builder#setOldSkuPurchaseToken(). Developers should use BillingFlowParams.SubscriptionUpdateParams.Builder#setOldPurchaseToken(java.lang.String) instead.

.setOldSkuPurchaseToken(oldToken)
.setReplaceSkusProrationMode(prorationMode)
.setOldPurchaseToken(oldToken)
.setSubscriptionReplacementMode(replacementMode)
Copy link
Author

@kus04e4ek kus04e4ek Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines -283 to -286
@Override
public void onPriceChangeConfirmationResult(BillingResult billingResult) {
emitSignal("price_change_acknowledged", billingResult.getResponseCode());
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onPriceChangeConfirmationResult is a method from PriceChangeConfirmationListener, which is deprecated

@owlnewworlds
Copy link

Sorry people, I'm currently loaded with work so I don't have time to get to this in the next 2 weeks at least. I'll try to review, merge and release as soon as possible though. Hope you understand ❤️

Of course we understand! ^^ Limit date is August 31 if I understood correctly so you have time :)

@MarcosFGS-CDS
Copy link

Hello, do we have any updates on this PR? 31 is getting closer every day, regardless any recommendation from the team about how to proceed for new projects until this is approved? thanks

@owlnewworlds
Copy link

Hello, do we have any updates on this PR? 31 is getting closer every day, regardless any recommendation from the team about how to proceed for new projects until this is approved? thanks

Same here. Time flies 😅 and I don't want my future builds to be blocked by Google because of that.

@MarcosFGS-CDS
Copy link

@timoschwarzer would you be able to provide an ETA for this to be reviewed and released?
If this is not possible
@kus04e4ek would you be able to provide some help on how to build your fork?
I keep getting gradle errors

Thank you in advance

@kus04e4ek
Copy link
Author

Would you be able to provide some help on how to build your fork? I keep getting gradle errors

Are you getting General error during semantic analysis: Unsupported class file major version? Then you need to install 14th version of Java and set your JAVA_HOME variable

@timoschwarzer
Copy link
Collaborator

@timoschwarzer would you be able to provide an ETA for this to be reviewed and released? If this is not possible @kus04e4ek would you be able to provide some help on how to build your fork? I keep getting gradle

@MarcosFGS-CDS I am not

@Yolwoocle
Copy link

Yolwoocle commented Sep 22, 2024

Any plans to merge this soon? The 31st august deadline has passed and I'm planning to release a game using this library. The last release is from a year ago...

@LMSSonos
Copy link

LMSSonos commented Oct 16, 2024

. This is not intended to override the official plugin but just a quick temporary solution.

I created a new fork in the meantime with all the fixes You just need to build the project with your Godot libs version.

@ivanfemia thanks for the fork. works as expected, only problem I have is that after calling payment.acknowledgePurchase() I get the purchase_acknowledged and purchase_acknowledgement_error events fired with the same token. Any idea?

Edit: I think it was related to the payment.billing_resume which is used according the official documentation, if I remove that and use the purchases_updated only, then it works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google requiring Google Play Billing Library version 6 or newer
9 participants