Interface IAppleStoreExtendedPurchaseService
A public interface for the Apple Store purchase service extension.
Namespace: UnityEngine.Purchasing
Assembly: Unity.Purchasing.dll
Syntax
public interface IAppleStoreExtendedPurchaseService : IPurchaseServiceExtension
Properties
appReceipt
Read the App Receipt from local storage. Returns null for iOS less than or equal to 6, may also be null on a reinstalling and require refreshing.
Declaration
[Obsolete]
string? appReceipt { get; }
Property Value
Type | Description |
---|---|
string |
simulateAskToBuy
For testing purposes only.
Modify payment request for testing ask-to-buy.
Declaration
bool simulateAskToBuy { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
ContinuePromotionalPurchases()
Continue promotional purchases that were intercepted by OnPromotionalPurchaseIntercepted
Declaration
void ContinuePromotionalPurchases()
PresentCodeRedemptionSheet()
Initiate Apple Subscription Offer Code redemption API, presentCodeRedemptionSheet
Declaration
void PresentCodeRedemptionSheet()
RefreshAppReceipt(Action<string>, Action<string>)
Fetch the latest App Receipt from Apple. This requires an Internet connection and will prompt the user for their credentials.
Declaration
[Obsolete]
void RefreshAppReceipt(Action<string> successCallback, Action<string> 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<string> | errorCallback | This action will be called when the refresh is in error. The error's details will be passed through. |
SetRefreshAppReceipt(bool)
Indicates whether to automatically refresh the app receipt when a purchase is made. This is useful if you are still using the receipt to validate purchases. True by default.
Declaration
[Obsolete]
void SetRefreshAppReceipt(bool refreshAppReceipt)
Parameters
Type | Name | Description |
---|---|---|
bool | refreshAppReceipt | Whether to refresh the app receipt automatically after a purchase. |
Events
OnEntitlementRevoked
Callback when an entitlement is revoked. The callback will return the product id that has been revoked.
Declaration
event Action<string>? OnEntitlementRevoked
Event Type
Type | Description |
---|---|
Action<string> |
OnPromotionalPurchaseIntercepted
Callback that will be called when the user attempts a promotional purchase (directly from the Apple App Store) on iOS or tvOS. The callback must be set before fetching products.
If the callback is set, you must call ContinuePromotionalPurchases()
inside it in order to continue the intercepted purchase(s).
Declaration
event Action<Product>? OnPromotionalPurchaseIntercepted
Event Type
Type | Description |
---|---|
Action<Product> |