fix: 增加苹果价格

This commit is contained in:
2025-12-17 21:59:02 -08:00
parent 554d12193e
commit 8f347d9183
3 changed files with 54 additions and 4 deletions
+7 -2
View File
@@ -60,8 +60,13 @@ class KRIAPService extends GetxService {
if (p.status == PurchaseStatus.pending) continue;
if (p.status == PurchaseStatus.error) {
if (p.pendingCompletePurchase) await _iap.completePurchase(p);
KRCommonUtil.kr_showToast('购买失败');
if (p.pendingCompletePurchase) {
await _iap.completePurchase(p); // ✅ 必须告诉苹果,这个错误我处理了
}
// 如果是用户主动取消,在这里清理 orderNo 是安全的
if (p.error?.message.contains('canceled') ?? false) {
await IAPPendingOrderService.clearPendingOrderNo();
}
KRCommonUtil.kr_hideLoading();
continue;
}