Method PurchaseProductAsync
PurchaseProductAsync(string, Action)
Initiates a purchase flow for the given product ID and awaits its completion.
Returns the purchased Product on success, or throws IapPurchaseException
on failure — check its Reason code rather than parsing the
message (e.g. Deferred for Ask-to-Buy, where the grant arrives
later via OnRestorePurchases).
Only one purchase can be in flight at a time; a concurrent call throws
InvalidOperationException.
onStartValidate fires when server-side receipt validation begins (optional).
public static Awaitable<Product> PurchaseProductAsync(string productId, Action onStartValidate = null)
Parameters
Returns
- Awaitable<Product>