最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

flutter - Error in Adapty In-App Purchase Implementation: StoreKitManagerError.productPurchaseFailed" - Stack Overflow

programmeradmin0浏览0评论

I am using adapty for the in app purchase, I have two product and user can chose the product and make the payment. I am getting the product list but while making the purchase I am getting an error like

(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)"}}))

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()));
      }
    });
  }
}

I have tried different sdk version but the same error I am getting.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论