Advanced in-app billing: handling alternative purchase flows
Posted by Oscar Rodriguez, Developer Advocate When designing and developing an app or game, at some point you may ask yourself if you want to monetize it. If you choose to do so by selling products via Google Play, you will most likely have a store screen that shows available items for sale, and use the Google Play Billing Library to display dialogs that allow your users to complete their purchase. While there is a more detailed explanation in the documentation and in the Billing Library TrivialDrive samples , the general flow is as follows: Call the launchBillingFlow() method from the UI thread to launch the Google Play purchase dialog. If the purchase was successful, Google Play calls the onPurchasesUpdated() method to deliver the result of the purchase operation. If your app has a server, we strongly recommend that you verify the purchase from your server by using the Subscriptions and In-App Purchases API . Acknowledge the purchase either with consumeAsync() for consumable it