xamarin / GooglePlayServicesComponents

Other
314 stars 146 forks source link

Xamarin.Android.Google.BillingClient: BillingClient.getConnectionState method not bound #740

Closed tipa closed 1 year ago

tipa commented 1 year ago

I am using the latest version of Xamarin.Android.Google.BillingClient: v5.1.0

Describe your Issue

The BillingClient class has the method "[getConnectionState](https://developer.android.com/reference/com/android/billingclient/api/BillingClient#getConnectionState())". However this method is not bound, likely because of this line? Would be great if it could be brought in.

mhdwaelanjo commented 1 year ago

try to use : <PackageReference Include="Anjoxam.BillingClient.Droid" Version="5.1.0" />

tipa commented 1 year ago

Thanks for surfacing that API! Sorry if this is nitpicking but I think this is a library that is used by many developers so I don't want to hold back with some observations:

Would it be possible to make these improvements?

moljac commented 1 year ago

Morn

Thanks for surfacing that API!

You re welcome. No need to thank me.

Sorry if this is nitpicking but I think this is a library that is used by many developers so I don't want to hold back with some observations:

It is not nitpicking, but tegitimate requestand your right and maybe even duty to request that.

  • the Java getConnectionState method isn't bound as as property ConnectionState, which is was I expected, but as method GetConnectionState

OK. This is easy. I need to see why it was not automagically bound as property. Sometimes it is because of inheritance chain. Today we think that enforcing properties for getters/setters was bad idea. It is nice for c# devs, but causes issues.

  • The BillingClient.ConnectionState isn't bound as enum

I will have to look at that one.

  • The GetConnectionState return value is an int, but I expected an BillingClient.ConnectionState enum

Why would you expect that? Was older API implemented as enum?

Would it be possible to make these improvements?

I hope so. When? President NotSure.

Please open new issue with these improvement suggestions/requests.

tipa commented 1 year ago

@moljac I submitted a PR with the proposed changes.

Why would you expect that? Was older API implemented as enum?

Other APIs in that library are implemented as enums, e.g BillingResult.getRepsonseCode or Purchase.getPurchaseState

moljac commented 1 year ago

@moljac I submitted a PR with the proposed changes.

Great. Thanks! Many thanks! This is ideal how we would like to work in open source. We need some help from your side.

Why would you expect that? Was older API implemented as enum? Other APIs in that library are implemented as enums, e.g BillingResult.getRepsonseCode or Purchase.getPurchaseState

I am not API expert. Sorry. 500+ packages. And we have less and less time for samples etc. I will try to collect some repo samples and add them to samples, but when. I have no idea.

I left few comments on PR.