iOS上 RevenueCat的实现问题——包含Flutter代码

移动开发 2026-07-11

一旦我在代码中尝试这样做

Future<void> loadProducts() async {
  try {
    final offerings = await Purchases.getOfferings();

    if (offerings.current == null) {
      log("No offering found", name: "RevenueCat");
      return;
    }

    final packages = offerings.current!.availablePackages;

    for (final package in packages) {
      log("Product: ${package.storeProduct.title}", name: "RevenueCat");
      log("Price: ${package.storeProduct.priceString}", name: "RevenueCat");
      log("ID: ${package.storeProduct.identifier}", name: "RevenueCat");
    }

  } catch (e) {
    log("Error fetching products: $e", name: "RevenueCat");
  }
}

在我的物理设备上运行时,出现如下错误:

There's a problem 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). 
More information: https://rev.cat/why-are-offerings-empty
More information: https://rev.cat/sdk-troubleshooting There's a problem 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). 
More information: https://rev.cat/why-are-offerings-empty
[RevenueCat] Error fetching products: PlatformException(23, There is an issue with your configuration. Check the underlying error for more details.
             More information: https://rev.cat/sdk-troubleshooting There's a problem 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). 
             More information: https://rev.cat/why-are-offerings-empty, {readableErrorCode: CONFIGURATION_ERROR, underlyingErrorMessage: , readable_error_code: CONFIGURATION_ERROR, code: 23, message: There is an issue with your configuration. Check the underlying error for more details.
             More information: https://rev.cat/sdk-troubleshooting There's a problem 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). 
             More information: https://rev.cat/why-are-offerings-empty}, null)

我快要崩溃了 🥹,因为显然一切都已正确配置并连接好

一切看起来都正确,我不知道错误是什么。

解决方案

当我遇到这个错误时,原因在于尽管我已经设置了Product、Offerings和 Entitlements,但我并没有选中我的Offering(我的名称是“default”,你们的可能是“pro”或“subscription”,或你命名的任意名称)。在该视图的下方有一个名为“Packages”的标签页,你需要选择并将 $rc_ 变量映射到不同平台的包里。

站内所有文章版权归属LeftHeroAI导航站,无授权禁止任何主体转载、抄袭、复制内容,亦不得私自架设镜像站点。一经侵权,本站将通过法律途径追责。

相关文章