ProductRequest
ProductRequest#
Parameters for fetching products from the store via fetchProducts().
Input to fetchProducts. iOS: passed to Product.products(for:) (Apple docs). Android: passed to BillingClient.queryProductDetailsAsync (Google docs).
Native references: Apple · Product.products(for:) · Google · QueryProductDetailsParams
Fields#
| Name | Summary |
|---|---|
skus | Array of product identifiers to fetch |
type | Product type filter (optional): "in-app" (default), "subs", or "all" |
Usage Example#
swift
// Fetch in-app purchases (default)
let inappProducts = try await OpenIapModule.shared.fetchProducts(
ProductRequest(skus: ["product1", "product2"])
)
// Fetch only subscriptions
let subscriptions = try await OpenIapModule.shared.fetchProducts(
ProductRequest(skus: ["sub1", "sub2"], type: .subs)
)
// Fetch all products (both in-app and subscriptions)
let allProducts = try await OpenIapModule.shared.fetchProducts(
ProductRequest(skus: ["product1", "sub1"], type: .all)
)