4

This has been asked many times, but in all the questions there wasn't any guide complete enough.

  • All the guides recycle the Sample project bundled with the billing library, even if on Android Developers it's clearly said that the util package should be written from scratch/heavily edited instead of just copying the stock one.
  • There are no directions on which data send to and how to verify on a personal server if the purchase is legitimate.
  • There's no hint, basically, on how to make the sample code stronger,i.e. on how to secure the key in a serverless environment, on how to generate and check a purchase payload and so on.

Maybe I've missed some line or I'm just a bit scared and confused, but I'm asking for some complete resource to consult and some clarification on the three doubts I wrote above.

Vektor88
  • 4,841
  • 11
  • 59
  • 111

1 Answers1

4

Since nobody is answering, I'll make an answer with useful resources for people unable to implement IAB.

New Sample references

This library is very lightweight and essential, it just works with managed products, but a fork also adds support for subscription products. Both the libraries don't offer any kind of support for querying the inventory, they just handle the purchase process, which is a better approach for my forma mentis. This library paired with the guides on Android Developers makes everything clearer.

This video shows the very basic implementation, this also just implements the purchase request and not the verification/inventory query.

Remote Server Verification

This article shows a simple method to verify purchase data with your public key, so you're not forced to insert it inside your own application. This guide shows the necessary steps to achieve validation with a PHP backend using Laravel.

Community
  • 1
  • 1
Vektor88
  • 4,841
  • 11
  • 59
  • 111