Skip to content

[Bug] Android: fetchProducts({ type: 'all' }) consider subscriptions to be in-app #238

Description

@404-html

Library

react-native-iap

Library version

react-native-iap 15.5.2

Affected platform

Android

Store

Google Play Store

Environment

react-native: 0.81.5
Emulator & physical device

What happened?

https://www.openiap.dev/docs/apis/fetch-products#parameters

Calling fetchProducts({ skus, type: 'all' }) works good only for in-app, but not subscriptions.
Subscriptions are returned as in-app with not found info.

Expected behavior

All products for provided sku's should be returned.

Reproduction steps

Call fetchProducts({ skus: ['subscription_id', 'in_app_id'], type: 'all' })

Following gets returned:

[
    {
        "id": "subscription_id",
        "title": "",
        "description": "",
        "type": "in-app",
        "displayName": null,
        "displayPrice": "",
        "currency": "",
        "price": null,
        "debugDescription": null,
        "platform": "android",
        "nameAndroid": "",
        "oneTimePurchaseOfferDetailsAndroid": null,
        "productStatusAndroid": "not-found",
        "subscriptionOffers": null,
        "discountOffers": null
    },    
    {
        "id": "in_app_id",
        "title": "[ANONYMIZED_PRODUCT_NAME] ([ANONYMIZED_CATEGORY])",
        "description": "[ANONYMIZED_DESCRIPTION]",
        "type": "in-app",
        "displayName": "[ANONYMIZED_PRODUCT_NAME]",
        "displayPrice": "799,99 PLN",
        "currency": "PLN",
        "price": 799.99,
        "debugDescription": "[ANONYMIZED_DESCRIPTION]",
        "platform": "android",
        "nameAndroid": "[ANONYMIZED_PRODUCT_NAME]",
        "oneTimePurchaseOfferDetailsAndroid": [
            {
                "formattedPrice": "799,99 PLN",
                "offerTags": [],
                "offerToken": "[REDACTED_OFFER_TOKEN]",
                "priceAmountMicros": "799990000",
                "priceCurrencyCode": "PLN",
                "purchaseOptionId": "legacy-base"
            }
        ],
        "productStatusAndroid": "ok",
        "subscriptionOffers": null,
        "discountOffers": [
            {
                "currency": "PLN",
                "discountAmountMicrosAndroid": null,
                "displayPrice": "799,99 PLN",
                "formattedDiscountAmountAndroid": null,
                "fullPriceMicrosAndroid": null,
                "id": null,
                "limitedQuantityInfoAndroid": null,
                "offerTagsAndroid": [],
                "offerTokenAndroid": "[REDACTED_OFFER_TOKEN]",
                "percentageDiscountAndroid": null,
                "preorderDetailsAndroid": null,
                "price": 799.99,
                "purchaseOptionIdAndroid": "legacy-base",
                "rentalDetailsAndroid": null,
                "type": "one-time",
                "validTimeWindowAndroid": null
            }
        ]
    }
]

Logs or stack trace

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions