purchases-flutter icon indicating copy to clipboard operation
purchases-flutter copied to clipboard

For active iOS Sandbox subscription `CustomerInfo.entitlements.active` returns empty list and `CustomerInfo.activeSubscriptions` return non-empty list

Open korolkir opened this issue 6 months ago • 2 comments

‼️ 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

  • [x] Output of flutter doctor [✓] Flutter (Channel stable, 3.32.2, on macOS 15.4.1 24E263 darwin-arm64, locale en-US) [!] Android toolchain - develop for Android devices (Android SDK version 35.0.1) ✗ cmdline-tools component is missing. Try installing or updating Android Studio. Alternatively, download the tools from https://developer.android.com/studio#command-line-tools-only and make sure to set the ANDROID_HOME environment variable. See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See https://flutter.dev/to/macos-android-setup for more details. [✓] Xcode - develop for iOS and macOS (Xcode 16.4) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.3) [✓] VS Code (version 1.101.1) [✓] Connected device (3 available) [✓] Network resources

  • [x] Version of purchases-flutter purchases_flutter: ^8.10.3

  • [x] Testing device version e.g.: iOS 18.5, Real device

  • [x] How often the issue occurs- Sandbox, for every test user

  • [x] Steps to reproduce, with a description of expected vs. actual behavior In sandbox purchase renewable subscription Expected: CustomerInfo.entitlements.active returns non-empty list Actual: CustomerInfo.entitlements.active returns empty list

Describe the bug

When sandbox user has an active subscriptions then CustomerInfo.entitlements.active returns empty list. According to docs it should be non-empty. In the other hand CustomerInfo.activeSubscriptions returns non-empty list. Code:

final info = await Purchases.getCustomerInfo();
print(info.entitlements.active.isNotEmpty); // prints false
print(info.entitlements.all.isNotEmpty); // prints false
print(info.activeSubscriptions.isNotEmpty); // prints true

Should I ignore docs and use CustomerInfo.activeSubscriptions to check if customer has an active subscription?

korolkir avatar Jun 22 '25 13:06 korolkir

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

RCGitBot avatar Jun 22 '25 13:06 RCGitBot

Hey @korolkir,

Thanks for reporting this and including the context!

Based on your description, this sounds like the subscription product is not yet linked to an entitlement in your RevenueCat dashboard. This would explain why activeSubscriptions is populated (the purchase is valid) but entitlements.active is empty (no mapping defined).

To verify the configuration:

  1. In your RevenueCat Dashboard, check that:

    • the exact product ID from activeSubscriptions appears in Products → [Your Product]
    • that product is linked to a Package in Offerings → [Your Offering] → Packages
    • the Package is associated with an Entitlement with the exact identifier your app expects
  2. Enable debug logging to see the raw response:

    await Purchases.setLogLevel(LogLevel.debug);
    

    Then capture logs from app launch → purchase → getCustomerInfo() call

  3. Version comparison: Could you test with purchases_flutter 8.10.2 to see if this behavior is consistent? This will help determine if it's a configuration issue or a regression.

If you'd prefer for us to investigate directly, please open a support ticket and reference this GitHub issue, we'll be happy to dig in deeper with account-level access.

Best, Gui from RevenueCat

GuilhermeMota93 avatar Jun 26 '25 10:06 GuilhermeMota93

Hello @GuilhermeMota93 The problem was with configuration of entitlements. Thanks for help! Closing the issue.

korolkir avatar Jun 28 '25 10:06 korolkir