Documentation

​
​

Development

User Acquisition

Monetization

Industry

In-App Purchasing

IAP Client API

IAP SDK API

Webshop Admin API

Webshop Client API

In-App Purchasing

LiveOps
​
​
Get started
  • Overview
  • Introduction to IAP
  • What's new in IAP v5.4
  • Upgrade from IAP v4 to v5
  • AI skill for In-App Purchasing
Direct to Consumer (D2C) payments
  • Direct to Consumer (D2C) payment providers
Webshop
  • Overview
  • Get started with webshops
  • Webshop setup
  • Catalog and payments
  • Game integration for webshops
  • Troubleshooting webshops
Platform-native stores
  • Set up IAP for platform-native stores
  • Codeless IAP
Catalogs and store management
  • Create product catalogs
  • Supported stores
    • Google Play Store
      • Add a Google license key to your project
      • Use Google Play billing extensions
    • Apple App Store
    • Stripe
    • Coda
    • Custom stores
    • Cross-store installation issues with Android in-app purchase store
Purchases
  • Purchase management and fulfillment
Monitor IAP performance
  • Overview
  • IAP revenue performance
  • D2C performance
Privacy
  • Privacy and consent
  1. Unity In-App Purchasing

Use Google Play billing extensions

Learn how to integrate Google Play-specific extensions with Unity IAP to enhance purchase handling and subscription management.
Read time 2 minutes
Last updated 7 months ago

Access Google Play-specific extensions for Unity IAP. Use obfuscated account and profile IDs for fraud prevention and account linking, and listen for deferred subscription payment changes when users modify their subscription tier.

Extended functionality

Learn how to use Google Play-specific features with Unity IAP.

Set and read obfuscated IDs

Use obfuscated account and profile IDs to associate purchases with user accounts while protecting user privacy. These identifiers help with fraud detection and can link purchases to your backend user system.
Note
Obfuscated IDs are set using
IGooglePlayStoreExtendedService
, but read from orders using
IGooglePlayStoreExtendedPurchaseService
.
using UnityEngine.Purchasing;class GooglePlayObfuscatedIdsSample{ static void SetObfuscatedIds(StoreController storeController, string profileId, string accountId) { var googlePlayStoreService = storeController.GooglePlayStoreExtendedService; if (googlePlayStoreService != null) { googlePlayStoreService.SetObfuscatedProfileId(profileId); googlePlayStoreService.SetObfuscatedAccountId(accountId); } } static void ReadObfuscatedIdsUsingConvenienceFunction(StoreController storeController, Order order) { var googlePlayPurchasingService = storeController.GooglePlayStoreExtendedPurchaseService; if (googlePlayPurchasingService != null) { var obfuscatedProfileId = googlePlayPurchasingService.GetObfuscatedProfileId(order); var obfuscatedAccountId = googlePlayPurchasingService.GetObfuscatedAccountId(order); //... } } static void ReadObfuscatedIdsFromOrder(Order order) { var profileId = order.Info.Google?.ObfuscatedProfileId; var accountId = order.Info.Google?.ObfuscatedAccountId; }}

Listen for deferred subscription changes

When a user changes their subscription tier (upgrade or downgrade) with a deferred payment, the change takes effect at the next renewal date. Use this listener to be notified when such changes occur, so you can update your UI or inform the user about their pending subscription change.
using UnityEngine.Purchasing;class AddGoogleEventListenersSample{ void AddGoogleEventListeners(StoreController storeController) { var googlePlayPurchasingService = storeController.GooglePlayStoreExtendedPurchaseService; if (googlePlayPurchasingService != null) { googlePlayPurchasingService.OnDeferredPaymentUntilRenewalDate += OnDeferredPaymentUntilRenewalDate; } } void OnDeferredPaymentUntilRenewalDate(DeferredPaymentUntilRenewalDateOrder deferredPaymentOrder) { var currentOrder = deferredPaymentOrder.CurrentOrder; var nextSubscriptionProduct = deferredPaymentOrder.SubscriptionOrdered; //... }}

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • Extended functionality

      • Set and read obfuscated IDs

      • Listen for deferred subscription changes


Report a problem with this page