Tag Archives: play billing

Google Play’s billing system: Update

Listening carefully to developer and user feedback is integral to how we continue to make Android better with each release, and improve how the Play Store works. Since we posted a clarification to our Play Payments policy, we have heard some additional questions from the community in India. Below we wanted to address and clearly respond to the topics we’ve heard.  


First and foremost, we want to reiterate that we are deeply committed to the success of the Indian ecosystem -- we do not succeed unless our partners succeed. Being mindful of local needs and concerns, we’ve taken the following immediate steps: 


  • We are setting up listening sessions with leading Indian startups to understand their concerns more deeply;

  • We will be setting up Policy Workshops to help clear any additional questions about our Play Store policies;

  • And we’re also extending the time for developers in India to integrate with the Play billing system, to ensure they have enough time to implement the UPI for subscription payment option that will be made available on Google Play -- for all apps that are yet to launch, or that currently use an alternative payment system, we set a timeline of 31st March 2022.


In addition, we’d like to provide more clarity on the three recurring topics we’ve heard from the Indian community: 

  • Whether this is a new policy and who it applies to;

  • The forms of payment the Google Play billing system supports;

  • Supporting choice of app stores on Android.


Last week we clarified the language in our Google Play Payments Policy in response to developer feedback that the policy language could be more clear regarding which types of transactions require the use of Google Play’s billing system. Our payments policy is not new -- it is our global business model and policy, and we have always required developers who distribute their apps on Play to use Google Play’s billing system if they offer in-app purchases of digital goods. In fact more than 97% of developers with apps on Google Play already comply with the policy. 


To be clear, the policy only applies if a developer charges users to download their app or they sell in-app digital items, which is less than 3% of developers with apps on Google Play. You can find more detail on our Payments Policy page and we’ve also posted a developer FAQ that answers many of the top developer questions. 


There has also been some confusion that Google Play billing is in itself a form of payment.  Google Play billing is a billing system that supports many ways for consumers to pay -- today Play’s billing supports more than 290 forms of payment globally. Over the last several years we have added more local forms of payment in India including credit and debit cards, netbanking, carrier billing, gift cards, and all supported UPI apps. And we will continue to engage with developers and consumers on adding additional forms of payment.  

 Google Play’s billing system is a payment platform that offers numerous payment options, on which UPI -- and all supported UPI apps -- are available, along with many other forms of payment including netbanking, credit and debit cards, carrier billing, and gift cards.


Note that Google Play’s billing system isn’t just about offering several forms of payment -- it helps ensure a great purchasing experience for Google Play users. It provides clear disclosures about price, what is being purchased, and key subscription information like when a charge will be incurred and whether a charge is recurring. It also includes post-purchase experiences including reminders about when free trials end, and is a one-stop shop for managing your subscription in Google Play including cancellations and refunds.


In short, our billing system provides a simple, safe way for consumers to transact -- and we have seen that this simplicity and safety is critical to growing developers’ businesses inside Google Play. 


Finally, we have always said developers should have a choice in how they distribute their apps, and that stores should compete for consumers’ and developers’ business. Android is open and choice is a core tenet of the operating system. It’s why users have always been able to get apps from multiple app stores and why they have always had control over which apps they use, be it their keyboard, messaging app, phone dialer, or app store. In fact, most Android devices ship with at least two app stores preinstalled, and consumers are able to install additional app stores.  


We consider it extremely important to understand the concerns across the ecosystem, and these listening sessions over the next several weeks will help us find comprehensive solutions that work for everyone. When a developer succeeds on the Play Store, we consider it our biggest win. At Google we have always had a long and deep commitment to India, and working alongside the startups and developers has given us a more meaningful understanding of how technology can be more helpful. And so we remain committed to engaging with the community, to listen and find the right ways to help the indian ecosystem grow and flourish.


Posted by Purnima Kochikar, Director of Business Development, Games & Applications, Google Play


Answering your FAQs about Google Play billing

We are committed to providing powerful tools and services to help developers build and grow their businesses while ensuring a safe, secure and seamless experience for users. Today we are addressing some of the most common themes we hear in feedback from developers. Below are a few frequently asked developer questions that we thought would also be helpful to address.

Q: Can I distribute my app via other Android app stores or through my website?

A: Yes, you can distribute your app however you like! As an open ecosystem, most Android devices come preinstalled with more than one store - and users can install others. Android provides developers the freedom and flexibility to distribute apps through other Android app stores, directly via websites, or device preloads, all without using Google Play’s billing system.

Q: What apps need to use Google Play's billing system?

A: All apps distributed on Google Play that are offering in-app purchases of digital goods need to use Google Play’s billing system. Our payments policy has always required this. Less than 3% of developers with apps on Play sold digital goods over the last 12 months, and of this 3%, the vast majority (nearly 97%) already use Google Play's billing. For those few developers that need to update their apps, they will have until September 30, 2021 to make those changes. New apps submitted after January 20, 2021 will need to be in compliance.

Q: Many businesses have needed to move their previously physical services online (e.g. digital live events). Will these apps need to use Google Play’s billing?

A: We recognize that the global pandemic has resulted in many businesses having to navigate the challenges of moving their physical business to digital and engaging customers in a new way, for example, moving in-person experiences and classes online. For the next 12 months, these businesses will not need to comply with our payments policy, and we will continue to reassess the situation over the next year. For developers undergoing these changes, we're eager to hear from you and work with you to help you reach new users and grow your online businesses, while enabling a consistent and safe user experience online.

Q: Do Google’s apps have to follow this policy too?

A: Yes. Google Play’s developer policies - including the requirement that apps use Google Play’s billing system for in-app purchases of digital goods - apply to all apps on Play, including Google’s own apps.

Q: Can I communicate with my users about alternate ways to pay?

A: Yes. Outside of your app you are free to communicate with them about alternative purchase options. You can use email marketing and other channels outside of the app to provide subscription offers and even special pricing.

Q: Can I communicate with my users about promotions on other platforms?

A: Of course. We're an app developer too, and we know how important it is not to restrict your ability to communicate with your users. You can email them or otherwise communicate outside of the app information about your offerings, even if they are different on Google Play than in other places.

Q: Can I have different app features, prices and experience depending on the platform?

A: Yes. It is your service and business, it is up to you. We do not require parity across platforms. You can create different versions of your app to support different platforms, features and pricing models.

Q: Can I offer a consumption-only (reader) app on Play?

A: Yes. Google Play allows any app to be consumption-only, even if it is part of a paid service. For example, a user could login when the app opens and the user could access content paid for somewhere else.

Q: Does your billing policy change depending on what category my app is in?

A: No. Business or consumer apps, and verticals like music or email are all treated the same on Google Play.

Q: Can I offer my customers refunds directly?

A: Yes. We understand the importance of maintaining the relationship with your customers. You can continue to issue refunds to your customers and other customer support directly.

Q: Will Google Play allow cloud gaming apps?

A: Yes. Cloud game streaming apps that comply with Play’s policies from any developer are welcome on Google Play.

For more examples and best practices for in-app purchases, visit this Play Academy course and watch this video.

Posted by Mrinalini Loew, Group Product Manager


Answering your FAQs about Google Play billing

We are committed to providing powerful tools and services to help developers build and grow their businesses while ensuring a safe, secure and seamless experience for users. Today we are addressing some of the most common themes we hear in feedback from developers. Below are a few frequently asked developer questions that we thought would also be helpful to address.

Q: Can I distribute my app via other Android app stores or through my website?

A: Yes, you can distribute your app however you like! As an open ecosystem, most Android devices come preinstalled with more than one store - and users can install others. Android provides developers the freedom and flexibility to distribute apps through other Android app stores, directly via websites, or device preloads, all without using Google Play’s billing system.

Q: What apps need to use Google Play's billing system?

A: All apps distributed on Google Play that are offering in-app purchases of digital goods need to use Google Play’s billing system. Our payments policy has always required this. Less than 3% of developers with apps on Play sold digital goods over the last 12 months, and of this 3%, the vast majority (nearly 97%) already use Google Play's billing. For those few developers that need to update their apps, they will have until September 30, 2021 to make those changes. New apps submitted after January 20, 2021 will need to be in compliance.

Q: Many businesses have needed to move their previously physical services online (e.g. digital live events). Will these apps need to use Google Play’s billing?

A: We recognize that the global pandemic has resulted in many businesses having to navigate the challenges of moving their physical business to digital and engaging customers in a new way, for example, moving in-person experiences and classes online. For the next 12 months, these businesses will not need to comply with our payments policy, and we will continue to reassess the situation over the next year. For developers undergoing these changes, we're eager to hear from you and work with you to help you reach new users and grow your online businesses, while enabling a consistent and safe user experience online.

Q: Do Google’s apps have to follow this policy too?

A: Yes. Google Play’s developer policies - including the requirement that apps use Google Play’s billing system for in-app purchases of digital goods - apply to all apps on Play, including Google’s own apps.

Q: Can I communicate with my users about alternate ways to pay?

A: Yes. Outside of your app you are free to communicate with them about alternative purchase options. You can use email marketing and other channels outside of the app to provide subscription offers and even special pricing.

Q: Can I communicate with my users about promotions on other platforms?

A: Of course. We're an app developer too, and we know how important it is not to restrict your ability to communicate with your users. You can email them or otherwise communicate outside of the app information about your offerings, even if they are different on Google Play than in other places.

Q: Can I have different app features, prices and experience depending on the platform?

A: Yes. It is your service and business, it is up to you. We do not require parity across platforms. You can create different versions of your app to support different platforms, features and pricing models.

Q: Can I offer a consumption-only (reader) app on Play?

A: Yes. Google Play allows any app to be consumption-only, even if it is part of a paid service. For example, a user could login when the app opens and the user could access content paid for somewhere else.

Q: Does your billing policy change depending on what category my app is in?

A: No. Business or consumer apps, and verticals like music or email are all treated the same on Google Play.

Q: Can I offer my customers refunds directly?

A: Yes. We understand the importance of maintaining the relationship with your customers. You can continue to issue refunds to your customers and other customer support directly.

Q: Will Google Play allow cloud gaming apps?

A: Yes. Cloud game streaming apps that comply with Play’s policies from any developer are welcome on Google Play.

For more examples and best practices for in-app purchases, visit this Play Academy course and watch this video.

Posted by Mrinalini Loew, Group Product Manager


Google Play Billing Library 1.0 released

Posted by Neto Marin, Developer Advocate

In June we announced the developer preview for a new Google Play Billing Library. Today, we are pleased to announce the official release of the Play Billing Library 1.0. This library simplifies the development process for Google Play Billing, allowing you to focus your efforts on your app.

Thank you for your valuable feedback and suggestions that helped us reach the 1.0 release. Watch the video below for a quick overview of the library's features.

Before you start

With Play Billing, you can receive payments from users around the world via a payment system they trust and you can take advantage of features and reports in the Play Console to manage and earn more revenue.

If you have never implemented in-app billing in your apps, or you want to know what you can offer using Play Billing Library, read the In-app Billing Overview to familiarize yourself with concepts and terminology that make it easier for you to implement In-app Billing using the Play Billing Library.

Getting started

Play Billing Library is available through Maven repository, and adding Play Billing Library to your project is simple as adding the following dependency into your app's build.gradle file:

dependencies {
    ...
    compile 'com.android.billingclient:billing:1.0'
}

The Play Billing Library 1.0 automatically adds the com.android.vending.BILLING permission to your APK. This means you no longer need to manually include it in your application module's manifest.

BillingClient and PurchasesUpdatedListener

These classes are the most important pieces when integrating the library into your Android app. The BillingClient is the bridge between your app and Google Play. You will use it for listing available products, starting the billing flow for in-app products or subscriptions (i.e. opening the payment interface), getting user purchases, and creating or modifying subscriptions.

When creating your BillingClient instance, you'll need to set a PurchasesUpdatedListener. This allows your app to receive updates from the In-app Billing API, including transaction results after the billing flow, as well as purchases completed outside of your app, e.g. user redeemed a Promo Code or bought a product on another device.

The following code demonstrates how you could override the )">onPurchasesUpdated() method of your PurchasesUpdatedListener:

@Override
void onPurchasesUpdated(@BillingResponse int responseCode,
        List<Purchase> purchases) {
    if (responseCode == BillingResponse.OK
            && purchases != null) {
        for (Purchase purchase : purchases) {
            handlePurchase(purchase);
        }
    } else if (responseCode == BillingResponse.USER_CANCELED) {
        // Handle an error caused by a user canceling the purchase flow.
    } else {
        // Handle any other error codes.
    }
}

You can implement the PurchasesUpdatedListener in your Activity or in any other class you want, according to your app's architecture. And here's the code for creating the BillingClient instance, and setting the PurchasesUpdatedListener:

mBillingClient = BillingClient.newBuilder(mContext)
                              .setListener(mPurchasesUpdatedListener)
                              .build();

Listing and selling products

To sell products in your app, first, you need to add them using the Play Console. For more details about how to add in-app products see the page Administering In-app Billing.

Attention: If this is a brand new app, before adding the products you must publish it to the alpha or beta distribution channel. For more information, see Draft Apps are No Longer Supported.

To get a list of product details with prices for current user, call , com.android.billingclient.api.SkuDetailsResponseListener)">querySkuDetailsAsync(). You must also specify a listener which implements the SkuDetailsResponseListener interface. You can then override the onSkuDetailsResponse() method which notifies the listener when the query finishes, as illustrated by the following sample code:

List<String> skuList = new ArrayList<> ();
skuList.add("premiumUpgrade");
skuList.add("gas");
mBillingClient.querySkuDetailsAsync(SkuType.INAPP , skuList,
    new SkuDetailsResponseListener() {
        @Override
        public void onSkuDetailsResponse(SkuDetailsResult result) {
            // Process the result.
        }
    })

After the user chooses a product to buy, you'll need to start the billing flow and handle the transaction result. To start a purchase request from your app, call the launchBillingFlow() method on the Play Billing Library client. You must call the launchBillingFlow() method (and all the other methods from BillingClient) from the UI thread.

The launchBillingFlow() method needs BillingFlowParams object that contains relevant data for completing the purchase, such as the product ID of the item to purchase and the product type (in this case, SkuType.INAPP). To get an instance of BillingFlowParams, construct it with newBuilder() method:

BillingFlowParams.Builder builder = BillingFlowParams
                                       .newBuilder()
                                       .setSku(skuId).setType(SkuType.INAPP);
int responseCode = mBillingClient.launchBillingFlow(builder.build());

As we mentioned earlier, the transaction result will be sent to the )">onPurchasesUpdated() method. For details how to process the data received on )">onPurchasesUpdated() and how to handle a purchase, check the section Purchase an item in our training guide.

Consuming products

By default, all in-app products are managed. It means that Google Play tracks the product ownership and doesn't allow to buy multiple times. To be able to buy a product again, you must consume the product before it becomes available again.

It's common to implement consumption for in-app products which users may want to purchase multiple times, such as in-game currency or equipment. You typically don't want to implement consumption for in-app products that user purchases once and provide a permanent effect, such as a premium upgrade.

To consume a product, call the consumeAsync() method on the Play Billing Library client and pass in the purchaseToken String value returned when you made the purchase. The consumption result is returned via onConsumeResponse() method of the ConsumeResponseListener interface, that you must override to handle the consumption result.

The following example illustrates consuming a product using the associated purchaseToken:

ConsumeResponseListener listener = new ConsumeResponseListener() {
    @Override
    public void onConsumeResponse(@BillingResponse int responseCode, 
                                  String outToken) {
        if (responseCode == BillingResponse.OK) {
            // Handle the success of the consume operation.
            // For example, increase the number of player's coins,
            // that provide temporary benefits
        }
    }
};
mBillingClient.consumeAsync(purchaseToken, listener);

Sample updated: Trivial Drive V2

With a new library comes a refreshed sample! To help you to understand how to implement in-app billing in your app using the new Play Billing Library, we've rewritten the Trivial Drive sample from the ground up.

Since we released Trivial Drive back in 2013, many new features, devices, and platforms have been added to the Android ecosystem. To reflect this evolution, the Trivial Drive v2 sample now runs on Android TV and Android Wear.

What's next?

Before integrating within your app, you can try the Play Billing Library with the codelab published during Google I/O 2017: Buy and Subscribe: Monetize your app on Google Play.

In this codelab, you will start with a simplified version of Trivial Drive V2 that lets users to "drive" and then you will add in-app billing to it. You'll learn how to integrate purchases and subscriptions as well as the best practices for developing reliable apps that handle purchases.

Get more info on the Play Billing Library and the official reference for classes and methods documentation on the Android Developers website. For a step-by-step guide to implementing the Play Billing Library in your project, visit the library's training class.

We still want your feedback

If you have issues or questions, file a bug report on the Google Issue Tracker, and for issues and suggestions on the sample (like a bug or a new feature), contact us on the Trivial Drive issues page.

For technical questions on implementation, library usage, and best practices, you can use the tags google-play and play-billing-library on StackOverflow or visit the communities on our Google+ page.