Google Play Billing Functions (API)
This section documents all public functions exposed by the Google Play Billing plugin.
These functions are available in both Blueprint and C++ through UGooglePlayBillingBlueprintLibrary and UGooglePlayBillingCPPLibrary. They are used to initialize Google Play Billing, query product information, launch and process purchases, check ownership, and access additional billing features.
The Blueprint and C++ interfaces expose the same functionality. Blueprint functions use dynamic delegates, while the C++ interface uses the corresponding native delegate types with the Native suffix.
Initialization
| Function | Parameters | Return / Callback | Description |
|---|---|---|---|
| Initialize Google Play Billing | OnSuccess (FOnGooglePlayBillingClientInitialized), OnFailure (FOnGooglePlayBillingClientInitializationFailed) |
Callback: OnSuccessCallback: OnFailure (ResponseCode: EGooglePlayBillingResponseCode, ErrorMessage: FString) |
Initializes the Billing Client and connects to Google Play. Call this once before using other Google Play Billing functions. If the Billing Client is already connected, OnSuccess is called immediately. |
| Is Google Play Billing Ready | - | bool |
Returns true if the Billing Client is connected and ready to process billing requests. |
Product Details
| Function | Parameters | Return / Callback | Description |
|---|---|---|---|
| Query Google Play Product Details | ProductIDs (TArray<FString>), ProductType (EGooglePlayBillingProductType), OnSuccess (FOnGooglePlayProductDetailsQuerySuccessful), OnFailure (FOnGooglePlayProductDetailsQueryFailed) |
Callback: OnSuccess (ProductDetails: TArray<FGooglePlayBillingProductDetails>)Callback: OnFailure (ResponseCode: EGooglePlayBillingResponseCode, ErrorMessage: FString) |
Requests product information from Google Play for multiple Product IDs of the selected product type. |
| Query Single Google Play Product Details | ProductID (FString), ProductType (EGooglePlayBillingProductType), OnSuccess (FOnSingleGooglePlayProductDetailsQuerySuccessful), OnFailure (FOnSingleGooglePlayProductDetailsQueryFailed) |
Callback: OnSuccess (ProductDetails: FGooglePlayBillingProductDetails)Callback: OnFailure (ResponseCode: EGooglePlayBillingResponseCode, ErrorMessage: FString) |
Requests product information from Google Play for a single Product ID of the selected product type. |
Non-Consumable Settings
| Function | Parameters | Return / Callback | Description |
|---|---|---|---|
| Set Google Play Non Consumable Products | ProductIDs (TArray<FString>) |
- | Replaces the current list of Product IDs treated as non-consumable by the automatic purchase flow. Products in this list remain owned and are not consumed automatically after purchase. |
| Is Google Play Product Non Consumable | ProductID (FString) |
bool |
Returns true if the Product ID is included in the current non-consumable product list. |
Purchase Flow
| Function | Parameters | Return / Callback | Description |
|---|---|---|---|
| Launch Google Play Billing Flow | ProductID (FString), ProductType (EGooglePlayBillingProductType), OfferToken (FString), OnSuccess (FOnGooglePlayPurchaseSuccessful), OnPending (FOnGooglePlayPurchasePending), OnCanceled (FOnGooglePlayPurchaseCanceled), OnFailure (FOnGooglePlayPurchaseFailed) |
Callback: OnSuccess (Purchase: FGooglePlayBillingPurchase)Callback: OnPending (Purchase: FGooglePlayBillingPurchase)Callback: OnCanceledCallback: OnFailure (ResponseCode: EGooglePlayBillingResponseCode, ErrorMessage: FString) |
Opens the Google Play purchase interface for a one-time product or subscription. Completed purchases are acknowledged automatically. One-time products not included in the non-consumable list are also consumed automatically. Leave OfferToken empty to use the default or first available purchase option. |
| Process Google Play Pending Purchases | ProductType (EGooglePlayBillingProductType), OnSuccess (FOnGooglePlayPendingPurchasesProcessingSuccessful), OnFailure (FOnGooglePlayPendingPurchasesProcessingFailed), OnCompleted (FOnGooglePlayPendingPurchasesProcessingCompleted) |
Callback: OnSuccess (Purchase: FGooglePlayBillingPurchase)Callback: OnFailure (ProductID: FString, PurchaseToken: FString, ResponseCode: EGooglePlayBillingResponseCode, ErrorMessage: FString)Callback: OnCompleted |
Queries purchases of the selected product type and processes completed purchases that still require automatic acknowledgement or consumption. OnSuccess and OnFailure may be called separately for each purchase. OnCompleted is called once after the complete processing request has finished. |
Ownership
| Function | Parameters | Return / Callback | Description |
|---|---|---|---|
| Query Google Play Owned Purchases | ProductType (EGooglePlayBillingProductType), OnSuccess (FOnGooglePlayOwnedPurchasesQuerySuccessful), OnFailure (FOnGooglePlayOwnedPurchasesQueryFailed) |
Callback: OnSuccess (Purchases: TArray<FGooglePlayBillingPurchase>)Callback: OnFailure (ResponseCode: EGooglePlayBillingResponseCode, ErrorMessage: FString) |
Returns the purchases currently owned by the user for the selected product type. |
| Is Google Play Product Purchased | ProductID (FString), OnStatusReceived (FOnGooglePlayNonConsumableProductStatusReceived) |
Callback: OnStatusReceived (bPurchased: bool) |
Checks whether the user currently owns the specified acknowledged non-consumable product. |
| Is Google Play Subscription Active | ProductID (FString), OnStatusReceived (FOnGooglePlaySubscriptionStatusReceived) |
Callback: OnStatusReceived (bActive: bool) |
Checks whether Google Play currently returns the specified acknowledged subscription as owned. |
Manual Flow
| Function | Parameters | Return / Callback | Description |
|---|---|---|---|
| Launch Google Play Billing Flow Manual | ProductID (FString), ProductType (EGooglePlayBillingProductType), OfferToken (FString), OnSuccess (FOnGooglePlayPurchaseSuccessful), OnPending (FOnGooglePlayPurchasePending), OnCanceled (FOnGooglePlayPurchaseCanceled), OnFailure (FOnGooglePlayPurchaseFailed) |
Callback: OnSuccess (Purchase: FGooglePlayBillingPurchase)Callback: OnPending (Purchase: FGooglePlayBillingPurchase)Callback: OnCanceledCallback: OnFailure (ResponseCode: EGooglePlayBillingResponseCode, ErrorMessage: FString) |
Opens the Google Play purchase interface without automatically acknowledging or consuming the completed purchase. The application must call Acknowledge Google Play Purchase or Consume Google Play Purchase after processing the purchase. Leave OfferToken empty to use the default or first available purchase option. |
| Acknowledge Google Play Purchase | PurchaseToken (FString), OnSuccess (FOnGooglePlayAcknowledgeSuccessful), OnFailure (FOnGooglePlayAcknowledgeFailed) |
Callback: OnSuccess (PurchaseToken: FString)Callback: OnFailure (ResponseCode: EGooglePlayBillingResponseCode, ErrorMessage: FString) |
Acknowledges a completed purchase using its Purchase Token. Use this for non-consumable products and subscriptions when using the manual purchase flow. |
| Consume Google Play Purchase | PurchaseToken (FString), OnSuccess (FOnGooglePlayConsumeSuccessful), OnFailure (FOnGooglePlayConsumeFailed) |
Callback: OnSuccessCallback: OnFailure (ResponseCode: EGooglePlayBillingResponseCode, ErrorMessage: FString) |
Consumes a completed one-time purchase using its Purchase Token so that the product can be purchased again. Use this for consumable products when using the manual purchase flow. |
Utilities
| Function | Parameters | Return / Callback | Description |
|---|---|---|---|
| Show Google Play In App Messages | OnSuccess (FOnGooglePlayShowInAppMessagesSuccessful), OnFailure (FOnGooglePlayShowInAppMessagesFailed) |
Callback: OnSuccess (Result: EGooglePlayBillingInAppMessageResult)Callback: OnFailure (ResponseCode: EGooglePlayBillingResponseCode, ErrorMessage: FString) |
Requests Google Play Billing to display an available in-app message, such as a subscription payment issue or another billing-related action. The result indicates whether the user completed an action or no action was required. |
| Is Google Play Billing Feature Supported | FeatureType (EGooglePlayBillingFeatureType) |
bool |
Returns true if the selected Google Play Billing feature is supported on the current device. |