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.