3

The official documentation is incredibly unclear when it comes how you’re supposed to be handling in-app billing.

For starters there are two versions of TrivialDrive:

github.com/googlesamples/android-play-billing

And then from the official docs:

developer.android.com/google/play/billing/billing_integrate.html

(here it says to import the IInAppBillingService.aidl file and use ServiceConnections / IInAppBillingService)

developer.android.com/training/play-billing-library/preparing-iab-app.html

(here it says to look at Trivial Drive v2, and also use compile 'com.android.billingclient:billing:dp-1' instead of importing the .aidl file, and to use BillingManager)

developer.android.com/training/in-app-billing/preparing-iab-app.html

(here it says to look at Trivial Drive, import the .aidl file, and use the IabHelper + associated listeners for everything instead)

Can anyone clarify why such a crucial part of the Android platform has different explanations for things all over the place? What's the intended / latest framework we need to be using? Which pieces are outdated? Which TrivialDrive should I be referencing?

user8251758
  • 143
  • 5

1 Answers1

0

As discussed in In-app Billing Version Notes, In-app Billing API is versioned with each version offering additional features to your app. With this, you may want to first check for your In-app Billing version.

At run time, your app can query the Google Play Store app to determine what version of the API it supports and what features are available.

  • If you are using in-app billing version 3 or later, the version information is not directly returned by Google Play. Instead, you can check if Google Play supports the version of the In-app Billing API that you are using by sending an isBillingSupported request.
  • If the In-app Billing API version that you are using is earlier than version 3, the version information is returned in the API_VERSION key of the Bundle object passed in the sendBillingRequest method. For more information, see In-app Billing Service Interface.

If you're using In-app Billing version 3 API, use this TrivialDrive for the Version 3 API as stated in In-app Billing Overview. Otherwise, see migration considerations wherein it was stated that,

The In-app Billing Version 2 API was discontinued in January 2015. If you have an existing In-app Billing implementation that uses API Version 2 or earlier, you must migrate to In-app Billing Version 3.

Lastly, this documentation is a preview release of the Play Billing Library. For In-app Billing Version 3 API, you may want to use this as reference instead.

Hope that helps in clearing things up.

Community
  • 1
  • 1
Teyam
  • 7,686
  • 3
  • 15
  • 22