You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Adapty内购实现报错:StoreKitManagerError.productPurchaseFailed

Adapty内购发起购买失败,SKErrorDomain Code=0(底层ASDErrorDomain Code=825)

问题详情

我正在用Adapty实现iOS应用内购功能,目前有两款产品可供用户选择支付。能正常获取产品列表,但调用makePurchase方法时触发如下错误:

(code: 0, message: Product purchase failed, detail: StoreKitManagerError.productPurchaseFailed([2.10.3]: Adapty/SK1QueueManager+MakePurchase.swift#50, Error Domain=SKErrorDomain Code=0 "An unknown error occurred" UserInfo={NSLocalizedDescription=An unknown error occurred, NSUnderlyingError=0x600000c3cc00 {Error Domain=ASDErrorDomain Code=825 "(null)"}}))

相关Flutter代码实现:

class PaymentBloc extends Bloc<PaymentEvent, PaymentState> {
  PaymentBloc() : super(PaymentInitial()) {
    on<StartPaymentEvent>((event, emit) async {
      final adapty = Adapty();
      try {
        emit(PaymentLoading());
        final paywall = await adapty.getPaywall(
          placementId: '##########',
        );
        final products = await adapty.getPaywallProducts(paywall: paywall);

        final selectedProduct =
            event.isSwitchEnabled ? products[1] : products[0];
        inspect(products);
        inspect(selectedProduct);
        final profile = await adapty.makePurchase(product: selectedProduct);
        log('#############################');
        inspect(profile);
        // var test = await adapty.restorePurchases();

        log('**********************************');
        // emit(PaymentSuccess(profile: profile!));
      } catch (error) {
        log('Error occurred during payment: $error');
        emit(PaymentFailure(error: error.toString()));
      }
    });
  }
}

已尝试更换不同版本的Adapty SDK,但问题依旧。

解决步骤

检查App Store Connect配置

  • 确认内购产品状态为已批准,未通过审核的产品无法发起购买流程。
  • 验证应用Bundle ID与App Store Connect中注册的完全一致,且内购产品已绑定到正确的App ID。
  • 确保测试设备登录的是有效的Sandbox测试账号,账号未被封禁,且账号所在地区支持该内购产品的销售区域。

排查ASDErrorDomain 825根源

该错误通常与签名、授权或产品配置相关:

  • 检查Xcode签名配置,确保使用正确的开发者证书,且开启自动管理签名。
  • 确认内购产品的价格等级设置有效,无无效的价格区域配置。
  • 执行Xcode缓存清理(Cmd+Shift+K),重新构建并安装应用。

验证Adapty配置

  • 核对Adapty Dashboard中配置的产品ID,与App Store Connect内购产品ID完全一致(注意大小写)。
  • 检查Paywall的placementId是否正确,且该Paywall已关联对应的内购产品。
  • 确认设备网络稳定,Adapty能正常与服务器通信(可通过日志确认产品获取阶段的请求状态)。

测试环境验证

  • 更换不同的Sandbox测试账号进行测试,排除单个账号的异常问题。
  • 在真机上测试,避免模拟器的StoreKit兼容性限制。

内容的提问来源于stack exchange,提问作者Krishna prasad

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 04:27:41