Interface IAppleExtensions
Access iOS specific functionality.
Namespace: UnityEngine.Purchasing
Syntax
public interface IAppleExtensions : IStoreExtension
Properties
simulateAskToBuy
For testing purposes only.
Modify payment request for testing ask-to-buy.
Declaration
bool simulateAskToBuy { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
ContinuePromotionalPurchases()
Call the UnityEarlyTransactionObserver.initiateQueuedPayments
Declaration
void ContinuePromotionalPurchases()
FetchStorePromotionOrder(Action<List<Product>>, Action)
Returns the current promoted product order on the device
Declaration
void FetchStorePromotionOrder(Action<List<Product>> successCallback, Action errorCallback)
Parameters
Type | Name | Description |
---|---|---|
Action<List<Product>> | successCallback | This action will be called when the fetch is successful. The list of products will be passed through. |
Action | errorCallback | This action will be called when the fetch is in error. |
FetchStorePromotionVisibility(Product, Action<String, AppleStorePromotionVisibility>, Action)
Returns the current promoted product order on the device
Declaration
void FetchStorePromotionVisibility(Product product, Action<string, AppleStorePromotionVisibility> successCallback, Action errorCallback)
Parameters
Type | Name | Description |
---|---|---|
Product | product | Product to change visibility. |
Action<String, AppleStorePromotionVisibility> | successCallback | This action will be called when the fetch is successful. The productId and visibility will be passed through. |
Action | errorCallback | This action will be called when the fetch is in error. |
GetIntroductoryPriceDictionary()
Extracting Introductory Price subscription related product details.
Declaration
Dictionary<string, string> GetIntroductoryPriceDictionary()
Returns
Type | Description |
---|---|
Dictionary<String, String> | returns the Introductory Price subscription related product details or an empty dictionary |
GetProductDetails()
Extracting product details.
Declaration
Dictionary<string, string> GetProductDetails()
Returns
Type | Description |
---|---|
Dictionary<String, String> | returns product details or an empty dictionary |
GetTransactionReceiptForProduct(Product)
Fetch the most recent iOS 6 style transaction receipt for the given product. This is necessary to validate Ask-to-buy purchases, which don't show up in the App Receipt.
Declaration
string GetTransactionReceiptForProduct(Product product)
Parameters
Type | Name | Description |
---|---|---|
Product | product | The product to fetch the receipt from. |
Returns
Type | Description |
---|---|
String | Returns the receipt if the product has a receipt or an empty string. |
PresentCodeRedemptionSheet()
Initiate Apple iOS 14 Subscription Offer Code redemption API, presentCodeRedemptionSheet
Declaration
void PresentCodeRedemptionSheet()
RefreshAppReceipt(Action<String>, Action)
Fetch the latest App Receipt from Apple. This requires an Internet connection and will prompt the user for their credentials.
Declaration
void RefreshAppReceipt(Action<string> successCallback, Action errorCallback)
Parameters
Type | Name | Description |
---|---|---|
Action<String> | successCallback | This action will be called when the refresh is successful. The receipt will be passed through. |
Action | errorCallback | This action will be called when the refresh is in error. |
RegisterPurchaseDeferredListener(Action<Product>)
Called when a processing a purchase from Apple that is in the "onProductPurchaseDeferred" state.
Declaration
void RegisterPurchaseDeferredListener(Action<Product> callback)
Parameters
Type | Name | Description |
---|---|---|
Action<Product> | callback | Action will be called with the product that is in the "onProductPurchaseDeferred" state. |
RestoreTransactions(Action<Boolean>)
Initiate a request to Apple to restore previously made purchases.
Declaration
void RestoreTransactions(Action<bool> callback)
Parameters
Type | Name | Description |
---|---|---|
Action<Boolean> | callback | Action will be called when the request to Apple comes back. The bool will be true if it was successful or false if it was not. |
SetApplicationUsername(String)
Modify payment request with "applicationUsername" for fraud detection.
Declaration
void SetApplicationUsername(string applicationUsername)
Parameters
Type | Name | Description |
---|---|---|
String | applicationUsername | The application Username for fraud detection. |
SetStorePromotionOrder(List<Product>)
Overrides the promoted product order on the device.
Declaration
void SetStorePromotionOrder(List<Product> products)
Parameters
Type | Name | Description |
---|---|---|
List<Product> | products | The new order of promoted products for the device. |
SetStorePromotionVisibility(Product, AppleStorePromotionVisibility)
Override the visibility of a product on the device.
Declaration
void SetStorePromotionVisibility(Product product, AppleStorePromotionVisibility visible)
Parameters
Type | Name | Description |
---|---|---|
Product | product | Product to change visibility. |
AppleStorePromotionVisibility | visible | The new product visibility. |