Open itsandreramon opened 3 years ago
the first code snippet in the documentation you link is this:
That code is here: https://github.com/android/play-billing-samples/blob/main/ClassyTaxiAppKotlin/app/src/main/java/com/example/subscriptions/billing/BillingClientLifecycle.kt#L89-L92
Unfortunately with a feature as complicated as in app purchase (which has at least 3 actors Your App, Google Play & Your Server) the examples in the documentation will not match a real world example.
The sample code is trying to account for the complexities of communication between 3 actors, as well as the tumultuous nature of mobile (read: Android) application development.
The sample app, takes in to consideration syncing, errors, duplicates, threading etc etc that the documentation does not.
My only recommendation would be to follow the documentation and implement each step as it explain it. Once finished delete all of that and start again by checking out the sample app and reading through how it does each step that you just learnt. Finally implementing In App Purchase yourself (to match your usecase) taking the best bits you have gleamed from a combination of the documentation and sample app.
Hope that helps!
Unfortunately with a feature as complicated as in app purchase (which has at least 3 actors Your App, Google Play & Your Server) the examples in the documentation will not match a real world example.
Sorry, but this points to a fundamental problem with Billing on Android which was a problem created by Google. What exactly is Google doing about it?
The sample code is trying to account for the complexities of communication between 3 actors, as well as the tumultuous nature of mobile (read: Android) application development.
Then both your sample and documentation produced by the Google Android Team is inadequate.
Stop blaming developers and asking them to put up with this nonsense.
Google isn't playing by their own rules: they force everyone onto 2 year version update cycle, yet with their endless money flow they themselves don't have enough resources to keep their samples updated accordingly. I bet these samples don't even have owners inside Google!
Hey, Google! Care to prove me wrong?
The documentation uses the Classy Taxi sample. Yet, I cannot find the code in the folder of this repo:
https://developer.android.com/google/play/billing/integrate
Am I missing something? Why is the sample code so complex?