Google Play 错误“从服务器 \[DF-DFERH-01\] 检索信息时出错”

新手上路,请多包涵

我刚刚完成了一款安卓游戏,我正在测试应用内购买功能。我正在使用 android.test.purchased 发送测试

直到几个小时前它工作正常。但是现在当我在google play中点击“接受并购买”时,商店给出了错误。

Google 播放错误“从服务器 [DF-DFERH-01] 检索信息时出错”

有谁知道这个错误是什么意思?

原文由 user922220 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1.2k
1 个回答

在 V5 计费的情况下,购买必须包括 setOfferToken(selectedOfferToken)

 ImmutableList productDetailsParamsList =
    ImmutableList.of(
        ProductDetailsParams.newBuilder()
             // retrieve a value for "productDetails" by calling queryProductDetailsAsync()
            .setProductDetails(productDetails)
            // to get an offer token, call ProductDetails.getSubscriptionOfferDetails()
            // for a list of offers that are available to the user
            .setOfferToken(selectedOfferToken)
            .build()
    );

BillingFlowParams billingFlowParams = BillingFlowParams.newBuilder()
    .setProductDetailsParamsList(productDetailsParamsList)
    .build();

// Launch the billing flow
BillingResult billingResult = billingClient.launchBillingFlow(activity, billingFlowParams);

如果 selectedOfferToken 无效,我们会收到上述错误。

https://developer.android.com/google/play/billing/integrate

要获得令牌,可以使用以下代码

ProductDetails productDetails;
String offerToken = "";
        if (productDetails.getSubscriptionOfferDetails() != null) {
            for(int i = 0; i < productDetails.getSubscriptionOfferDetails().size();i++) {
                offerToken =  productDetails.getSubscriptionOfferDetails().get(i).getOfferToken();
                if(!offerToken.isEmpty()){
                    break;
                }
            }
        }

原文由 tanni tanna 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题