Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getProducts doesn't return products that exist in getOfferings #1199

Open
lukepighetti opened this issue Oct 31, 2024 · 2 comments
Open

getProducts doesn't return products that exist in getOfferings #1199

lukepighetti opened this issue Oct 31, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@lukepighetti
Copy link

Given a known store product id id, getProducts does not return the product on Android

 // always returns `null`
final p = await Purchases.getProducts([id]).then((e) => e.firstOrNull);

 // always returns the correct StoreProduct
final p = await Purchases.getOfferings().then((e) => e.all.values
    .map((e) => e.availablePackages.map((e) => e.storeProduct))
    .flattened
    .toSet()
    .firstWhereOrNull((e) => e.identifier == id));
@lukepighetti lukepighetti added the bug Something isn't working label Oct 31, 2024
@RCGitBot
Copy link
Contributor

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

@mshmoustafa
Copy link
Contributor

Hey @lukepighetti is the product a non-subscription product by any chance? If yes, you have to specify what kind of products you want to pull: https://sdk.revenuecat.com/android/8.9.0/purchases/com.revenuecat.purchases/-purchases/get-products.html?query=fun%20getProducts(productIds:%20List%3CString%3E,%20type:%20ProductType?%20=%20null,%20callback:%20GetStoreProductsCallback)

getOfferings will pull both subscription and non-subscription products for you, which is why I'm guessing that's the issue.

Let me know if that doesn't help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants