Skip to main content

SDK Reference - getProductsForSale

React native
Flutter
Swift
Kotlin

The getProductsForSale method retrieves the list of products ready for purchase. It checks the products you've set up in your listing, making it easier for you to display them on your paywall.

It is important to note that configuring the sandbox environment on iOS and Android is necessary to be able to test products that aren't approved yet and make test purchases for free. Otherwise the method will return an empty array.

Example

var productsForSale = await Iaphub.getProductsForSale();
React Native
Flutter
Swift
Kotlin

Parameters

This method does not require any parameters.

Response

Array
Object
StringIAPHUB product ID
typeValues
StringProduct type
StringProduct sku
NumberPrice amount
StringPrice currency
StringLocalized product price (Ex: '$12.99')
StringLocalized product title from IAPHUB if available; otherwise, the title from Apple or Google
StringLocalized product description from IAPHUB if available; otherwise, the title from Apple or Google.
Only available if the product belongs to a group
StringIAPHUB group ID
StringName of the product group created on IAPHUB
Only available if the product has associated metadata
ObjectProduct metadata
Only available for a subscription
StringDuration of the subscription cycle specified in the ISO 8601 format
ArrayOrdered list of the subscription intro phases
Array element
typeValues
StringIntro phase type
NumberIntro phase price
StringIntro phase currency code (Ex: 'USD')
StringIntro phase localized price (Ex: '$2.99')
NumberNumber of cycles of the intro phase
StringDuration of a cycle specified in the ISO 8601 format