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
productType
ValuesStringProduct type
StringProduct sku
NumberPrice amount
StringPrice currency
StringLocalized price (Ex: '$12.99')
StringProduct title (Ex: 'Membership')
StringProduct description (Ex: 'Join the community with a membership')
Only available if the product belongs to a group
Only available for a subscription
subscriptionDuration
ValuesStringDuration of the subscription cycle specified in the ISO 8601 format
ArrayOrdered list of the subscription intro phases
Array element
type
ValuesStringIntro 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
cycleDuration
ValuesStringDuration of a cycle specified in the ISO 8601 format