using System;
using System.Collections.Generic;
namespace UnityEngine.Purchasing
{
///
/// Access iOS specific functionality.
///
public interface IAppleExtensions : IStoreExtension
{
///
/// Fetch the latest App Receipt from Apple.
/// This requires an Internet connection and will prompt the user for their credentials.
///
/// This action will be called when the refresh is successful. The receipt will be passed through.
/// This action will be called when the refresh is in error. The error's details will be passed through.
void RefreshAppReceipt(Action successCallback, Action errorCallback);
///
/// Fetch the latest App Receipt from Apple.
/// This requires an Internet connection and will prompt the user for their credentials.
///
/// This action will be called when the refresh is successful. The receipt will be passed through.
/// This action will be called when the refresh is in error.
[Obsolete("RefreshAppReceipt(Action successCallback, Action errorCallback) is deprecated, please use RefreshAppReceipt(Action successCallback, Action errorCallback) instead.")]
void RefreshAppReceipt(Action successCallback, Action errorCallback);
///
/// 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.
///
/// The product to fetch the receipt from.
/// Returns the receipt if the product has a receipt or an empty string.
string GetTransactionReceiptForProduct(Product product);
///
/// Initiate a request to Apple to restore previously made purchases.
///
/// 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.
[Obsolete("RestoreTransactions(Action callback) is deprecated, please use RestoreTransactions(Action callback) instead.")]
void RestoreTransactions(Action callback);
///
/// Initiate a request to Apple to restore previously made purchases.
///
/// Action will be called when the request to Apple comes back. The bool will be true if it was successful with a null string or false if it was not with the error message in the string.
void RestoreTransactions(Action callback);
///
/// Called when a processing a purchase from Apple that is in the "onProductPurchaseDeferred" state.
///
/// Action will be called with the product that is in the "onProductPurchaseDeferred" state.
void RegisterPurchaseDeferredListener(Action callback);
///
/// Modify payment request with "applicationUsername" for fraud detection.
///
/// The application Username for fraud detection.
void SetApplicationUsername(string applicationUsername);
///
/// For testing purposes only.
///
/// Modify payment request for testing ask-to-buy.
///
bool simulateAskToBuy { get; set; }
///
/// Returns the current promoted product order on the device
///
/// This action will be called when the fetch is successful. The list of products will be passed through.
/// This action will be called when the fetch is in error.
void FetchStorePromotionOrder(Action> successCallback, Action errorCallback);
///
/// Overrides the promoted product order on the device.
///
/// The new order of promoted products for the device.
void SetStorePromotionOrder(List products);
///
/// Returns the current promoted product order on the device
///
/// Product to change visibility.
/// This action will be called when the fetch is successful. The productId and visibility will be passed through.
/// This action will be called when the fetch is in error.
void FetchStorePromotionVisibility(Product product, Action successCallback, Action errorCallback);
///
/// Override the visibility of a product on the device.
///
/// Product to change visibility.
/// The new product visibility.
void SetStorePromotionVisibility(Product product, AppleStorePromotionVisibility visible);
///
/// Call the `UnityEarlyTransactionObserver.initiateQueuedPayments`
///
void ContinuePromotionalPurchases();
///
/// Extracting Introductory Price subscription related product details.
///
/// returns the Introductory Price subscription related product details or an empty dictionary
Dictionary GetIntroductoryPriceDictionary();
///
/// Extracting product details.
///
/// returns product details or an empty dictionary
Dictionary GetProductDetails();
///
/// Initiate Apple iOS 14 Subscription Offer Code redemption API, presentCodeRedemptionSheet
///
void PresentCodeRedemptionSheet();
}
///
/// This enum is a C# representation of the Apple object `SKProductStorePromotionVisibility`.
/// https://developer.apple.com/documentation/storekit/skproductstorepromotionvisibility?changes=latest__7
///
/// Converted to a string (ToString) to pass to Apple native code, so do not change these names.
///
public enum AppleStorePromotionVisibility
{
///
/// C# representation of Apple's object `SKProductStorePromotionVisibility.default`
/// https://developer.apple.com/documentation/storekit/skproductstorepromotionvisibility/default?changes=latest__7
///
Default,
///
/// C# representation of Apple's object `SKProductStorePromotionVisibility.hide`
/// https://developer.apple.com/documentation/storekit/skproductstorepromotionvisibility/hide?changes=latest__7
///
Hide,
///
/// C# representation of Apple's object `SKProductStorePromotionVisibility.show`
/// https://developer.apple.com/documentation/storekit/skproductstorepromotionvisibility/show?changes=latest__7
///
Show
}
}