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

Flutter内购ChargeProratedPrice订阅替换模式不生效问题排查请求

Flutter内购ChargeProratedPrice订阅替换模式不生效问题排查请求

大家好,我最近在做Flutter应用的Google Play订阅替换功能时遇到了个卡壳的问题,想请教下各位同行有没有遇到过类似情况或者有排查思路。

情况是这样的:我在Google Play Console的同一个订阅组下配置了4个基础订阅计划,使用in_app_purchase包来处理订阅的升级/降级逻辑。但试了好几次发现,只有设置ReplacementMode.chargeFullPrice的时候替换能正常完成,换成chargeProratedPrice这种按比例收费的模式,就会直接弹出“Something went wrong on our end”的错误提示,完全走不通。

我先贴一下当前的核心代码:

final PurchaseDetails oldPurchaseDetails = purchasesOnline.firstWhere(
  (element) => element.status == PurchaseStatus.purchased || element.status == PurchaseStatus.restored,
);

// recordAnalyticsChangeSub(oldPurchaseDetails, product);

if (oldPurchaseDetails is GooglePlayPurchaseDetails) {
  // 安卓端需要手动处理订阅升级/降级
  PurchaseParam purchaseParam = GooglePlayPurchaseParam(
    productDetails: product,
    changeSubscriptionParam: ChangeSubscriptionParam(
      oldPurchaseDetails: oldPurchaseDetails,
      replacementMode: ReplacementMode.chargeProratedPrice, // 只有chargeFullPrice能正常工作
    ),
  );
  await InAppPurchase.instance
      .buyNonConsumable(purchaseParam: purchaseParam);
  changingPlan = false;
}

我已经确认了旧订阅的状态确实是已购买或者已恢复的,参数传递也都是按照包的要求来的,但就是非全额收费的模式死活用不了。有没有朋友知道这可能是哪里出了问题?比如Google Play后台的订阅组配置有没有什么特殊要求,或者这个包的使用有没有什么容易忽略的细节?

内容来源于stack exchange

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.08 09:18:06