SDK Reference - getProducts
React native
Flutter
Swift
Kotlin
The getProducts method retrieves both the products available for sale and the active products for the user with just one call.
This saves you from having to make separate calls to the getProductsForSale and getActiveProducts methods.
Example
var products = await Iaphub.getProducts();
React Native
Flutter
Swift
Kotlin
Parameters
ObjectOptions
String[]Include filtered subscription states
Response
Object
ArrayProducts for sale
Array
Object
StringIAPHUB product ID
type
ValuesStringProduct 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
Only available if the product has associated metadata
ObjectProduct metadata
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
ArrayActive products
Array
Object
StringIAPHUB product ID
type
ValuesStringProduct 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
Only available if the product has associated metadata
ObjectProduct metadata
StringIAPHUB purchase ID
StringPurchase date
platform
ValuesStringPlatform
BooleanIndicates if the purchase was made in the sandbox environment (testing)
BooleanIndicates if the purchase was made using a promo code
StringPromo code
(Android: only available for subscriptions vanity codes, not available for one time codes) (iOS: the value is the offer reference name)
StringAndroid purchase token
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
StringSubscription expiration date
StringSubscription original purchase id
StringIndicates if the subscription will renew automatically
StringSubscription product id of the next renewal (only defined if different than the current product)
StringSubscription product sku of the next renewal (only defined if different than the current product)
subscriptionState
ValuesStringCurrent state of the subscription
subscriptionPeriodType
ValuesStringPeriod type of the subscription
StringDate when the subscription will automatically resume after being paused (Android subscriptions only).