Fetching Products
Fetch your product catalog from Onside with a products request, read product details, and handle errors.
Create and start a request
@MainActor static func makeProductsRequest(productIdentifiers: Set<String>) -> OnsideProductsRequestimport OnsideKit
final class ProductsViewController: UIViewController {
private var productsRequest: OnsideProductsRequest?
private var products: [OnsideProduct] = []
func fetchProducts() {
let identifiers: Set<String> = [
"premium_feature",
"subscription_monthly",
]
let request = Onside.makeProductsRequest(productIdentifiers: identifiers)
request.delegate = self
self.productsRequest = request // retain it for the whole request
request.start()
}
}Handle the response
The response object
Read a product
Property
Description
Errors
Case
Cause
Suggested handling
Fetching across regions
Last updated
Was this helpful?