Interface IGooglePlayConfiguration
Access Google Play store specific configurations.
Namespace: UnityEngine.Purchasing
Syntax
public interface IGooglePlayConfiguration : IStoreConfiguration
Methods
SetDeferredProrationUpgradeDowngradeSubscriptionListener(Action<Product>)
Set listener for deferred subscription change events. Deferred subscription changes only take effect at the renewal cycle and no transaction is done immediately, therefore there is no receipt nor token.
Declaration
void SetDeferredProrationUpgradeDowngradeSubscriptionListener(Action<Product> action)
Parameters
Type | Name | Description |
---|---|---|
Action<Product> | action | Deferred subscription change event. No payout is granted here. Instead, notify the user that the subscription change will take effect at the next renewal cycle. |
SetDeferredPurchaseListener(Action<Product>)
Set listener for deferred purchasing events. Deferred purchasing is enabled by default and cannot be changed.
Declaration
void SetDeferredPurchaseListener(Action<Product> action)
Parameters
Type | Name | Description |
---|---|---|
Action<Product> | action | Deferred purchasing successful events. Do not grant the item here. Instead, record the purchase and remind the user to complete the transaction in the Play Store. |
SetFetchPurchasesAtInitialize(Boolean)
Set behavior at initialization of fetching purchase data. Use before calling UnityPurchasing.Initialize.Initialize
.
Disable to prevent IStoreListener.ProcessPurchase.ProcessPurchase
from automatically returning entitled purchases at initialization.
This allows greater control when tracking the origin of purchases.
Then use IGooglePlayStoreExtensions.RestoreTransactions.RestoreTransactions
to fetch as-yet unseen entitled purchases.
Default is true
.
Declaration
void SetFetchPurchasesAtInitialize(bool enable)
Parameters
Type | Name | Description |
---|---|---|
Boolean | enable |
SetFetchPurchasesExcludeDeferred(Boolean)
Set behavior when fetching deferred purchases. Use before calling UnityPurchasing.Initialize.Initialize
.
Exclude to prevent deferred purchases from being fetched and processed by IStoreListener.ProcessPurchase.ProcessPurchase
at initialization.
When false, deferred purchases need to be handled in IStoreListener.ProcessPurchase.ProcessPurchase
to prevent granting unpaid purchases.
Default is true
.
Declaration
void SetFetchPurchasesExcludeDeferred(bool exclude)
Parameters
Type | Name | Description |
---|---|---|
Boolean | exclude |
SetObfuscatedAccountId(String)
Optional obfuscation string to detect irregular activities when making a purchase. For more information please visit https://developer.android.com/google/play/billing/security
Declaration
void SetObfuscatedAccountId(string accountId)
Parameters
Type | Name | Description |
---|---|---|
String | accountId | The obfuscated account id |
SetObfuscatedProfileId(String)
Optional obfuscation string to detect irregular activities when making a purchase For more information please visit https://developer.android.com/google/play/billing/security
Declaration
void SetObfuscatedProfileId(string profileId)
Parameters
Type | Name | Description |
---|---|---|
String | profileId | The obfuscated profile id |
SetQueryProductDetailsFailedListener(Action<Int32>)
Set an optional listener for failures when querying product details.
Declaration
void SetQueryProductDetailsFailedListener(Action<int> action)
Parameters
Type | Name | Description |
---|---|---|
Action<Int32> | action | Will be called with the retry count for each failed attempt to query product details. |
SetServiceDisconnectAtInitializeListener(Action)
Set an optional listener for failures when connecting to the base Google Play Billing service. This may be called
after UnityPurchasing.Initialize.Initialize
if a user does not have a Google account added to their
Android device.
This listener can be used to learn that initialization is paused, and the user must add a Google account in order to be able to purchase and to download previous purchases. Adding a valid account will allow the initialization to resume.
Declaration
void SetServiceDisconnectAtInitializeListener(Action action)
Parameters
Type | Name | Description |
---|---|---|
Action | action | Will be called when |