-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
base: master
Are you sure you want to change the base?
Conversation
"At least 1 approving review is required by reviewers with write access." |
Tested on my production games, work fine. Please release it when possible. ❤️ |
What's the state of the issue ? A lot of Godot Android devs are blocked / scared about that. |
. 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 |
Thank you! Well I still have time to wait for the official lib to be fixed but I hope it will be ASAP :) |
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) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
public Dictionary updateSubscription(String oldToken, String sku, int replacementMode) { | ||
return purchaseInternal(oldToken, sku, replacementMode); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comment above
PriceChangeFlowParams priceChangeFlowParams = | ||
PriceChangeFlowParams.newBuilder().setSkuDetails(skuDetails).build(); | ||
|
||
billingClient.launchPriceChangeConfirmationFlow(getActivity(), priceChangeFlowParams, this); |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See this comment
@Override | ||
public void onPriceChangeConfirmationResult(BillingResult billingResult) { | ||
emitSignal("price_change_acknowledged", billingResult.getResponseCode()); | ||
} |
There was a problem hiding this comment.
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
Of course we understand! ^^ Limit date is August 31 if I understood correctly so you have time :) |
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. |
@timoschwarzer would you be able to provide an ETA for this to be reviewed and released? Thank you in advance |
Are you getting |
@MarcosFGS-CDS I am not |
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... |
@ivanfemia thanks for the fork. works as expected, only problem I have is that after calling Edit: I think it was related to the |
@ivanfemia how can i get the .aar file from your fork, which i paste in my project? |
Probably a bit late, but for anyone else trying to make this work I managed to get a version that runs with I achieved this by cloning the fork from this other PR ( #64 ) which fixes all the Java/Gradle/Godot issues, and then manually applying the changes from this PR on top of it. I just did this today and haven't had a chance to test purchases yet, but it built successfully, and runs without issue on my test device, and I was able to submit it to Google Play without any errors about the outdated payment plugin. I'm sad there is no longer a valid official library to support in app purchases for Godot. Hope this can be resolved soon. |
@itslenny would you be able to link the built .aar file(s)? I also found another solution that I haven't tried out yet, but supposedly supports version 7 play billing. |
I tried that other one you linked as well before doing this route. I think that one WOULD work, but it wouldn't build for me because of Java / Gradle versions, and rather than do a work around with older versions of Java I decided to try to get to the latest and greatest. I've submitted a PR of my combined changes here: #74 I'm hoping to test this a bunch over the next week, but for now it is entirely untested, but I think it's very much a step in the right direction, but I do fully expect there to be some bugs. I also uploaded a release on my fork that includes the built If you get a chance to try it out let me know if you find any issues. |
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
toBillingFlowParams.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 havingprice_change_acknowledged
is not critical.