Skip to main content
Question

iOS Widget Extension - Warning when setting the SDK

  • December 20, 2025
  • 3 replies
  • 32 views

Forum|alt.badge.img+1

I read a few other threads about this topic, and followed the suggestion: configure the SDK as earlier as possible. I also followed the instructions in the docs. This is how I am setting it up:

      let configuration = Configuration.Builder(withAPIKey: "my_api_key")

        .with(userDefaults: .init(suiteName: groupIdentifier)!)

        .build()

      

      Purchases.configure(with: configuration)

 

Despite this, I am getting:

ERROR: 😿‼️ RevenueCat SDK Configuration is not valid



Your app's Bundle ID 'com.foo.bar.widgetextension' doesn't match the RevenueCat configuration 'com.foo.bar'. This will cause the SDK to not show any products and won't allow users to make purchases. Please update your Bundle ID in either your app or the RevenueCat website to match.



Please visit the RevenueCat website to resolve the issue: https://app.revenuecat.com/projects/c89a1ec9/apps/appa3ee8cada1


I guess my question is: what am I missing here? I just need to check if the user is subscribed or not. 

This post has been closed for comments

3 replies

guilherme
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • December 30, 2025

Hey ​@RuiPeres - this warning is happening because Purchases.configure(...) is being called in your widget extension target with your main app's API key. The SDK sees the extension's bundle ID (com.foo.bar.widgetextension) but the RevenueCat app for that key is configured for com.foo.bar, so it won't initialize and logs that configuration error.
 
Since you only need to check if the user is subscribed, you can configure RevenueCat only in the main app, using the shared App Group UserDefaults:

let configuration = Configuration
.builder(withAPIKey: "your_main_app_api_key")
.with(userDefaults: UserDefaults(suiteName: "group.your.bundle.here")!)
.build()

Purchases.configure(with: configuration)

In the main app, after you get CustomerInfo, write a simple flag into the App Group:

let isSubscribed = customerInfo.entitlements["your_entitlement"]?.isActive == true
UserDefaults(suiteName: "group.your.bundle.here")?
.set(isSubscribed, forKey: "isSubscribed")

Then in your widget extension target:

// Don't use RevenueCat SDK here at all - just read the flag
let defaults = UserDefaults(suiteName: "group.your.bundle.here")
let isSubscribed = defaults?.bool(forKey: "isSubscribed") ?? false
// Update your widget UI based on isSubscribed

This avoids the bundle ID mismatch completely because the widget never initializes the SDK.

Alternatively, you can have a “read only widget” that also calls RevenueCat directly. This would mean to:

  1. add com.foo.bar.widgetextension as a separate iOS app in the same RevenueCat project and get its own public SDK key
  2. use the main app's key in your main app target, and the widget's key in your widget extension target
  3. configure in both targets, sharing the same App Group UserDefaults:

On your main app side:

let configuration = Configuration
.builder(withAPIKey: "main_app_api_key")
.with(userDefaults: UserDefaults(suiteName: "group.your.bundle.here")!)
.build()

Purchases.configure(with: configuration)

and on your Widget extension:

let configuration = Configuration
.builder(withAPIKey: "widget_extension_api_key") // Different key!
.with(userDefaults: UserDefaults(suiteName: "group.your.bundle.here")!)
.build()

Purchases.configure(with: configuration)

Purchases.shared.getCustomerInfo { customerInfo, error in
let isSubscribed = customerInfo?.entitlements["your_entitlement"]?.isActive == true
// Update your widget UI
}

This should also work, but feels a bit more work. In this approach the widget remains read-only (so purchases won't work there), but this clears the configuration error because each bundle ID has its own matching app in RevenueCat.


Forum|alt.badge.img+1
  • Author
  • New Member
  • January 1, 2026

Hi ​@guilherme,

I am happy with read-only for the Widget. While using the same id, I can see on the Widget:


ERROR: 😿‼️ RevenueCat SDK Configuration is not valid

 

Your app's Bundle ID 'com.foo.bar.widgetextension' doesn't match the RevenueCat configuration 'com.foo.bar. This will cause the SDK to not show any products and won't allow users to make purchases. Please update your Bundle ID in either your app or the RevenueCat website to match.

 

Please visit the RevenueCat website to resolve the issue: https://app.revenuecat.com/projects/c89a1ec9/apps/appa3ee8cada1
```

 

However I can still read the value successfully in the Widget via:

let info = try await Purchases.shared.customerInfo()

 


guilherme
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • January 8, 2026

Just to double check, as that is not expected, are you still calling Purchases.configure(...) from the widget extension target then? Or any other SDK call from the widget?

If you only need to read whether the user is subscribed, the simplest approach is to keep RevenueCat configured only in the main app (using the shared App Group UserDefaults), write a boolean like isSubscribed there, and then have the widget read that value, without initializing the RevenueCat SDK in the widget at all:

  • Main app: fetch CustomerInfo and write isSubscribed into the App Group UserDefaults

  • Widget: remove any Purchases.configure(...) / RevenueCat calls, and just read isSubscribed from the same App Group

That should both avoid the bundle ID mismatch warning and keep the widget logic nice and lightweight