-
Notifications
You must be signed in to change notification settings - Fork 64
Restore QueryProductDetailsResult and fix QueryProductDetailsAsync behavior #1207
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
Conversation
…havior Co-authored-by: jonathanpeppers <[email protected]>
QueryProductDetailsAsync behavior change
jonathanpeppers
left a comment
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.
Do we need to add the partial modifier:
D:\a\_work\1\s\source\com.android.billingclient\billing\Additions\Additions.cs(30,18): error CS0260: Missing partial modifier on declaration of type 'QueryProductDetailsResult'; another partial declaration of this type exists [D:\a\_work\1\s\generated\com.android.billingclient.billing\com.android.billingclient.billing.csproj::TargetFramework=net10.0-android36.0]
D:\a\_work\1\s\source\com.android.billingclient\billing\Additions\Additions.cs(250,79): error CS0535: 'InternalProductDetailsResponseListener' does not implement interface member 'IProductDetailsResponseListener.OnProductDetailsResponse(BillingResult, QueryProductDetailsResult)' [D:\a\_work\1\s\generated\com.android.billingclient.billing\com.android.billingclient.billing.csproj::TargetFramework=net10.0-android36.0]
D:\a\_work\1\s\source\com.android.billingclient\billing\Additions\Additions.cs(30,18): error CS0260: Missing partial modifier on declaration of type 'QueryProductDetailsResult'; another partial declaration of this type exists [D:\a\_work\1\s\generated\com.android.billingclient.billing\com.android.billingclient.billing.csproj::TargetFramework=net9.0-android35.0]
D:\a\_work\1\s\source\com.android.billingclient\billing\Additions\Additions.cs(250,79): error CS0535: 'InternalProductDetailsResponseListener' does not implement interface member 'IProductDetailsResponseListener.OnProductDetailsResponse(BillingResult, QueryProductDetailsResult)' [D:\a\_work\1\s\generated\com.android.billingclient.billing\com.android.billingclient.billing.csproj::TargetFramework=net9.0-android35.0]
198 Warning(s)
4 Error(s)
If that doesn't work, tell me what the existing bound QueryProductDetailsResult type looks like. You should be able to find it generated somewhere in an obj folder.
…mplementation Co-authored-by: jonathanpeppers <[email protected]>
Fixed both issues! Added the |
jonathanpeppers
left a comment
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.
That last commit doesn't make sense. It may build, but it isn't right.
- Revert 265625c
- Mark
QueryProductDetailsResultaspartial. Push that change. - Report the build errors from just that change if any.
- Find the generated
QueryProductDetailsResultclass and share its contents here.
…Result Co-authored-by: jonathanpeppers <[email protected]>
Co-authored-by: jonathanpeppers <[email protected]>
Reverted commit 265625c and fixed the issues properly in commit d1de5f6. Build errors after adding just the Here's the generated public sealed partial class QueryProductDetailsResult : global::Java.Lang.Object {
public unsafe global::System.Collections.Generic.IList<global::Android.BillingClient.Api.ProductDetails> ProductDetailsList { get; }
public unsafe global::System.Collections.Generic.IList<global::Android.BillingClient.Api.UnfetchedProduct> UnfetchedProductList { get; }
public static unsafe global::Android.BillingClient.Api.QueryProductDetailsResult Create (global::System.Collections.Generic.IList<global::Android.BillingClient.Api.ProductDetails> productDetailsList, global::System.Collections.Generic.IList<global::Android.BillingClient.Api.UnfetchedProduct> unfetchedProductList)
}The generated interface expects: void OnProductDetailsResponse(BillingResult result, QueryProductDetailsResult queryProductDetailsResult)Fixed by updating the partial class to add a proper |
…lementation" This reverts commit d1de5f6.
Obsolete ProductDetails in favor of ProductDetailsList
|
Would either of you be able to test the resulting package (remove Specifically looking if APIs related to @copilot take no action on this comment. |
|
I'll check it on weekend and let you know. |
|
@jonathanpeppers I tried to test it but there's a dependency error, see below. The latest version of When I just try to update |
|
There were some unreleased packages on main, if you try again are you able to test now? |
|
I did another attempt on testing this, now I get a lot of those build errors: |
|
@tipa thanks for trying, you might just need to specify: <PackageReference Include="Xamarin.AndroidX.SavedState" Version="1.3.0.1" />I'm inclined to merge this, as it has to be better than what is released. But I don't know 100% that it works end-to-end. |
|
@jonathanpeppers thanks, manually specifying However, I now experience a crash using the
The same code does not crash when using |

This PR restores the
QueryProductDetailsResulttype and fixes theQueryProductDetailsAsyncbehavior that was inadvertently broken in PR #1200.Problem
In PR #1200, the billing client was updated from version 7.1.1 to 8.0.0, but the changes introduced a breaking change to the API:
QueryProductDetailsResultclass was removedQueryProductDetailsAsyncmethod was changed to pass through aQueryProductDetailsResultparameter directly instead of creating a new instanceChanges Made
1. Restored QueryProductDetailsResult Class
2. Fixed QueryProductDetailsAsync Method
Restored the original behavior that creates a new
QueryProductDetailsResultinstance:3. Updated Internal Listener Signature
Fixed
InternalProductDetailsResponseListenerto use the correct parameter types:4. Version Bump
Updated the
nugetVersionfrom "8.0.0" to "8.0.0.1" in config.json to reflect this API restoration.Impact
This change restores the API to work as it did before PR #1200, ensuring backward compatibility for developers using
QueryProductDetailsAsync. The method now properly returns aQueryProductDetailsResultcontaining both theBillingResultand the list ofProductDetails.Fixes #1206.
This pull request introduces updates to the Android Billing Client integration, including a version bump for NuGet and enhancements to the handling of product details in the billing API. The changes aim to improve compatibility and functionality while maintaining backward compatibility.
Summary
Updated the
nugetVersionfrom8.0.0to8.0.0.1to reflect the latest version of the NuGet package.Enhancements to Product Details Handling:
source/com.android.billingclient/billing/Additions/Additions.cs: Added a newQueryProductDetailsResultclass with properties forBillingResultandProductDetailsList. Marked theProductDetailsproperty as obsolete to encourage the use ofProductDetailsList. This ensures future-proofing while maintaining backward compatibility.source/com.android.billingclient/billing/Additions/Additions.cs: Updated theOnProductDetailsResponsemethod inInternalProductDetailsResponseListenerto initializeQueryProductDetailsResultif null and set theResultproperty before invoking the response handler. This improves stability and ensures consistent handling of responses.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.