Instance Method

getProducts(_:completion:)

Fetches the StoreProducts for your IAPs for given productIdentifiers.

Declaration

@objc(getProductsWithIdentifiers:completion:) func getProducts(_ productIdentifiers: [String], completion: @escaping ([StoreProduct]) -> Void)

Parameters

productIdentifiers

A set of product identifiers for in-app purchases setup via AppStoreConnect This should be either hard coded in your application, from a file, or from a custom endpoint if you want to be able to deploy new IAPs without an app update.

completion

An @escaping callback that is called with the loaded products. If the fetch fails for any reason it will return an empty array.

Discussion

Use this method if you aren’t using getOfferings(completion:). You should use getOfferings(completion:) though.

See Also

Displaying Products