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

Calling getProducts in Android returns an empty list #1152

Closed
11 tasks done
cerealexx opened this issue Aug 25, 2024 · 7 comments
Closed
11 tasks done

Calling getProducts in Android returns an empty list #1152

cerealexx opened this issue Aug 25, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@cerealexx
Copy link

cerealexx commented Aug 25, 2024

‼️ Required data ‼️

Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.

There are a lot of things that can contribute to things not working. Having a very basic understanding of your environment will help us understand your issue faster!

Environment

  • Output of flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-arm64, locale es-ES)
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    [✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 2023.1)
    [✓] VS Code (version 1.92.2)
    [✓] Connected device (5 available)
    [✓] Network resources
    • No issues found!

  • Version of purchases-flutter
    8.0.0

  • Testing device version e.g.: iOS 15.5, Android API 30, etc.
    Any Android

  • How often the issue occurs- every one of your customers is impacted? Only in dev?
    Always

  • Debug logs that reproduce the issue
    D/[Purchases] - DEBUG(32143): Retrieving customer info with policy: FETCH_CURRENT
    D/[Purchases] - DEBUG(32143): ℹ️ Updating pending purchase queue
    D/[Purchases] - DEBUG(32143): ℹ️ Offerings cache is stale, updating from network in foreground
    D/[Purchases] - DEBUG(32143): 😻 Start Offerings update from network.
    D/[Purchases] - DEBUG(32143): Request already scheduled with jitter delay, adding existing callbacks to unjittered request with key: BackgroundAwareCallbackCacheKey(cacheKey=[/subscribers/da8841ea-f9dd-4ce3-a3b2-45757d18db3b/offerings], appInBackground=false)
    D/[Purchases] - DEBUG(32143): ℹ️ Querying purchases
    D/[Purchases] - DEBUG(32143): ℹ️ Updating pending purchase queue
    D/[Purchases] - DEBUG(32143): ℹ️ Found 0 unsynced attributes for App User ID: da8841ea-f9dd-4ce3-a3b2-45757d18db3b
    D/[Purchases] - DEBUG(32143): ℹ️ No subscriber attributes to synchronize.
    D/[Purchases] - DEBUG(32143): ℹ️ Starting connection for com.android.billingclient.api.BillingClientImpl@2c81454
    V/[Purchases] - VERBOSE(32143): No paywall events to sync.
    D/[Purchases] - DEBUG(32143): ℹ️ Billing Service Setup finished for com.android.billingclient.api.BillingClientImpl@2c81454
    D/[Purchases] - DEBUG(32143): ℹ️ Updating pending purchase queue
    V/[Purchases] - VERBOSE(32143): Billing client: Initiating getting country code.
    D/[Purchases] - DEBUG(32143): ℹ️ Cleaning previously sent tokens
    D/[Purchases] - DEBUG(32143): ℹ️ Tokens already posted: []
    D/[Purchases] - DEBUG(32143): ℹ️ Saving tokens []
    D/[Purchases] - DEBUG(32143): ℹ️ Tokens already posted: []
    D/[Purchases] - DEBUG(32143): ℹ️ No pending purchases to sync
    D/[Purchases] - DEBUG(32143): Request already scheduled with jitter delay, adding existing callbacks to unjittered request with key: BackgroundAwareCallbackCacheKey(cacheKey=[/subscribers/da8841ea-f9dd-4ce3-a3b2-45757d18db3b], appInBackground=false)
    V/[Purchases] - VERBOSE(32143): Setting storefront cache to ES
    D/[Purchases] - DEBUG(32143): Billing connected with country code: ES
    D/[Purchases] - DEBUG(32143): API request started: GET /subscribers/da8841ea-f9dd-4ce3-a3b2-45757d18db3b/offerings
    D/[Purchases] - DEBUG(32143): API request completed with status: GET /subscribers/da8841ea-f9dd-4ce3-a3b2-45757d18db3b/offerings 304
    E/[Purchases] - ERROR(32143): 😿‼️ Error fetching offerings - PurchasesError(code=ConfigurationError, underlyingErrorMessage=There are no products registered in the RevenueCat dashboard for your offerings. If you don't want to use the offerings system, you can safely ignore this message. To configure offerings and their products, follow the instructions in https://rev.cat/how-to-configure-offerings.
    E/[Purchases] - ERROR(32143): More information: https://rev.cat/why-are-offerings-empty, message='There is an issue with your configuration. Check the underlying error for more details.')
    2
    D/[Purchases] - DEBUG(32143): ℹ️ Querying purchases
    D/[Purchases] - DEBUG(32143): ℹ️ Cleaning previously sent tokens
    D/[Purchases] - DEBUG(32143): ℹ️ Tokens already posted: []
    D/[Purchases] - DEBUG(32143): ℹ️ Saving tokens []
    D/[Purchases] - DEBUG(32143): ℹ️ Tokens already posted: []
    D/[Purchases] - DEBUG(32143): ℹ️ No pending purchases to sync
    D/[Purchases] - DEBUG(32143): ℹ️ Cleaning previously sent tokens
    D/[Purchases] - DEBUG(32143): ℹ️ Tokens already posted: []
    D/[Purchases] - DEBUG(32143): ℹ️ Saving tokens []
    D/[Purchases] - DEBUG(32143): ℹ️ Tokens already posted: []
    D/[Purchases] - DEBUG(32143): ℹ️ No pending purchases to sync
    D/[Purchases] - DEBUG(32143): API request started: GET /subscribers/da8841ea-f9dd-4ce3-a3b2-45757d18db3b
    D/[Purchases] - DEBUG(32143): API request completed with status: GET /subscribers/da8841ea-f9dd-4ce3-a3b2-45757d18db3b 304
    D/[Purchases] - DEBUG(32143): 😻 CustomerInfo updated from network.
    D/[Purchases] - DEBUG(32143): Retrieving customer info with policy: CACHED_OR_FETCHED
    D/[Purchases] - DEBUG(32143): ℹ️ Vending CustomerInfo from cache.
    D/[Purchases] - DEBUG(32143): ℹ️ Checking if cache is stale AppInBackground false
    D/[Purchases] - DEBUG(32143): Retrieving customer info with policy: CACHED_OR_FETCHED
    D/[Purchases] - DEBUG(32143): ℹ️ Vending CustomerInfo from cache.
    D/[Purchases] - DEBUG(32143): ℹ️ Checking if cache is stale AppInBackground false
    D/[Purchases] - DEBUG(32143): ℹ️ setAttributes called
    D/[Purchases] - DEBUG(32143): ℹ️ Requesting products from the store with identifiers: reverse_health
    D/[Purchases] - DEBUG(32143): ℹ️ Products request finished for reverse_health
    D/[Purchases] - DEBUG(32143): 💰 Retrieved productDetailsList:
    D/[Purchases] - DEBUG(32143): ℹ️ setAttributes called

  • Steps to reproduce, with a description of expected vs. actual behavior

  • Actual:
    Called getProducts with a correct list of identifiers for active subscriptions in Android. An empty list is returned.

  • Expected:
    Called getProducts with a correct list of identifiers for active subscriptions in Android. A list of StoreProduct is returned.

Describe the bug

I don't use offerings. I call getPurchases with correct identifier reverse_health, yet an empty list is returned. Works fine in iOS.
Here's an image showing the existing product:
Captura de pantalla 2024-08-25 a las 10 02 10

Additional context

Add any other context about the problem here.

@cerealexx cerealexx added the bug Something isn't working label Aug 25, 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!

@cerealexx
Copy link
Author

Nevermind... it's working now. I guess there's a delay between adding the products to RevenueCat and then being able to retrieve them with the sdk?

@LawalTalkbiz
Copy link

I have the same issue, how did you fix it?

@cerealexx
Copy link
Author

It suddenly worked. So I guess there's some kind of asynchronous processing when creating products for RevenueCat 🤷‍♂️

@LawalTalkbiz
Copy link

@cerealexx How long does it takes?

@cerealexx
Copy link
Author

I have no idea, I lost faith and the next day it just worked

@LawalTalkbiz
Copy link

Thank you u will wait

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