Skip to content

Latest commit

 

History

History
174 lines (126 loc) · 5.37 KB

File metadata and controls

174 lines (126 loc) · 5.37 KB

StoreKit Configuration Fix

Date: 2025-11-12 Status: ✅ FIXED


🔍 Problem Identified

RevenueCat was failing to fetch products with error:

There is an issue with your configuration. None of the products registered
in the RevenueCat dashboard could be fetched from App Store Connect (or the
StoreKit Configuration file if one is being used).

🎯 Root Cause

The Xcode scheme was pointing to the WRONG StoreKit configuration file.

What Was Wrong

Scheme file location:

apps/ios/LogYourBody.xcodeproj/xcshareddata/xcschemes/LogYourBody.xcscheme

Incorrect StoreKit reference (line 77-79):

<StoreKitConfigurationFileReference
   identifier = "../../../../../../../../Library/Developer/Xcode/DerivedData/LogYourBody-andvtxgbkkjzbydambbpvmldnenp/SourcePackages/checkouts/purchases-ios/Examples/rc-maestro/rc-maestro/Resources/StoreKit/StoreKitConfiguration.storekit">
</StoreKitConfigurationFileReference>

This was pointing to:

  • RevenueCat's example app StoreKit configuration
  • Located in: DerivedData/.../purchases-ios/Examples/rc-maestro/...
  • Contains RevenueCat's demo products, NOT your LogYourBody products

Why This Happened

When you use RevenueCat's SDK and test in Xcode, if you:

  1. Open RevenueCat's example project to learn how it works
  2. Then return to your project
  3. Xcode sometimes "helpfully" keeps the StoreKit config from the example

This is a common gotcha with Xcode's StoreKit testing.


✅ The Fix (Commit 18664f0b3)

Updated the scheme to point to the correct StoreKit configuration:

Correct StoreKit reference:

<StoreKitConfigurationFileReference
   identifier = "../LogYourBody.storekit">
</StoreKitConfigurationFileReference>

Now points to:

  • Your LogYourBody.storekit file
  • Located at: apps/ios/LogYourBody.storekit
  • Contains YOUR subscription products:
    • com.logyourbody.app.pro.annual.3daytrial ($79.99/year, 3-day trial)
    • com.logyourbody.app.pro.monthly.3daytrial ($9.99/month, 3-day trial)

🧪 Testing the Fix

When you run the app now in Xcode, you should see:

✅ Expected Console Output

💰 Configuring RevenueCat SDK
💰 RevenueCat SDK configured successfully
✅ SDK marked as configured
💰 Identifying user: user_xxxxx
[DEBUG] - Purchases - v5.x.x - GET purchases_v5 200
💰 Customer info updated
💰 Fetching offerings
[DEBUG] - Purchases - v5.x.x - GET subscribers/user_xxx/offerings 200
💰 Fetched 1 offerings
💰 Current offering: Default
💰 Available packages: 2
  📦 Package: $rc_annual
     Price: $79.99
     Product: com.logyourbody.app.pro.annual.3daytrial
  📦 Package: $rc_monthly
     Price: $9.99
     Product: com.logyourbody.app.pro.monthly.3daytrial

✅ PaywallView Should Display:

  • Loading indicator (brief)
  • "3-DAY FREE TRIAL" badge ← Should now appear!
  • Price card showing "$79.99 / year"
  • Subtext: "Just $5.75 per month, billed annually"
  • "Start Free Trial" button ← The button should now appear!
  • "Restore Purchases" link

📋 Complete Fix Summary (All 5 Commits)

1. Commit 51e6ca7e8: SDK Configuration Timing

Fixed isConfigured flag being set asynchronously

2. Commit cfb8e29a0: Package Fallback & Enhanced Debugging

Added fallback logic to show any available package

3. Commit 5c446c6d4: RevenueCat Verification Documentation

Verified all RevenueCat dashboard configuration via API

4. Commit 451442e88: Info.plist API Key (CRITICAL #1)

Added missing REVENUE_CAT_API_KEY entry to Info.plist

5. Commit 18664f0b3: StoreKit Configuration (CRITICAL #2)

Fixed Xcode scheme to point to LogYourBody.storekit


🎯 How to Verify in Xcode

  1. Open Xcode
  2. Product → Scheme → Edit Scheme (⌘<)
  3. Select RunOptions tab
  4. Verify StoreKit Configuration shows: LogYourBody.storekit

If it shows anything else or is blank, select LogYourBody.storekit from the dropdown.


🔍 How to Prevent This in Future

Best Practices:

  1. Always check scheme StoreKit configuration when:

    • Cloning the project
    • Switching between projects
    • After opening example apps
  2. Verify the configuration points to YOUR storekit file, not:

    • Example project configs
    • DerivedData paths
    • Absolute paths to other projects
  3. Keep LogYourBody.storekit in the same directory as your xcodeproj


📚 Related Files


📖 Apple Documentation


The RevenueCat integration should now work correctly! 🎉

Both critical issues are now resolved:

  1. ✅ API key properly passed to runtime (Info.plist fix)
  2. ✅ StoreKit configuration pointing to correct file (Scheme fix)