PlayStorePurchaseListener | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
public interface

# PlayStorePurchaseListener

com.google.android.gms.ads.purchase.PlayStorePurchaseListener

## Class Overview

Interface definition for implementing an in-app purchase using the default purchase flow.

## Summary

Public Methods
abstract boolean | isValidPurchase(String productId) Called when the user triggers an in-app purchase.
abstract void | onInAppPurchaseFinished(InAppPurchaseResult inAppPurchaseResult) Called when the user has completed an in-app purchase transaction.

## Public Methods

#### public abstract boolean isValidPurchase (String productId)

Called when the user triggers an in-app purchase. Return `true` if this purchase is valid.

##### Parameters

productId | The product ID (SKU) of the requested product.

#### public abstract void onInAppPurchaseFinished (InAppPurchaseResult inAppPurchaseResult)

Called when the user has completed an in-app purchase transaction. The publisher is responsible for crediting the user with the product, and calling `finishPurchase()` to consume the purchase.

##### Parameters

inAppPurchaseResult | The `InAppPurchaseResult` containing the result of the purchase.