android - 从服务器 [DF-AA-20] 检索信息时发生应用内购买错误

标签 android google-play in-app-purchase in-app-billing

我正在尝试启用应用计费。我在我的 google play 控制台上创建了应用内产品并获得了我的许可证 key 。当我尝试购买产品时。我得到这个图像错误。

enter image description here

这是我用来创建 BillingProcessor 的代码。

bp = new BillingProcessor(this, LICENSE_KEY, MERCHANT_ID, new BillingProcessor.IBillingHandler() {
        @Override
        public void onProductPurchased(@NonNull String productId, @Nullable TransactionDetails details) {
            showToast("onProductPurchased: " + productId);
            updateTextViews();
        }
        @Override
        public void onBillingError(int errorCode, @Nullable Throwable error) {
            showToast("onBillingError: " + Integer.toString(errorCode));
        }
        @Override
        public void onBillingInitialized() {
            showToast("onBillingInitialized");
            readyToPurchase = true;
            updateTextViews();
        }
        @Override
        public void onPurchaseHistoryRestored() {
            showToast("onPurchaseHistoryRestored");
            for(String sku : bp.listOwnedProducts())
                Log.d(LOG_TAG, "Owned Managed Product: " + sku);
            for(String sku : bp.listOwnedSubscriptions())
                Log.d(LOG_TAG, "Owned Subscription: " + sku);
            updateTextViews();
        }
    });

LICENSE_KEY 是我从 google play console 获得的许可证 key ,MERCHANT_ID 为空。

我就是这样买东西的。

bp.purchase(this,PRODUCT_ID);

其中 PRODUCT_ID 是我在我的 google play 控制台中使用的产品 1,这里是我的应用内产品的示例。

enter image description here

知道如何解决这个问题吗?只有一个 DF-AA-20 问题没有答案的计算器问题。互联网上没有关于它的信息。我尝试过使用模拟器和我的 android 手机。

最佳答案

DF-AA-20 表示您的应用未以任何方式在 Play 商店中发布。这通常是因为:

  • 您还没有发布它。要测试应用内结算,它必须至少被推送到 alpha。参见 the testing IAB docs 了解更多信息
  • 您的应用或开发者帐户已因滥用而被禁止/暂停
  • 您对您的包名称/applicationId 进行了一些更改,以便您的 apk 中的它与 Play 中的不匹配。开发人员有时会使用构建风格来做到这一点

关于android - 从服务器 [DF-AA-20] 检索信息时发生应用内购买错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47777955/

相关文章:

android - 为什么我的if语句只运行android中的else部分

java - Android Thread Concourrency UI线程编辑一个变量,其他线程读取相同的变量

android - 将android应用程序上传到android market

android - 应用内结算优惠券

android - 下载新的Beta版本后,应用程序未更新

android - 如何在不支付真钱的情况下测试应用内购买

android - 在 Android 的 ViewPager2 中检测越界滑动

android - 如何在 Android 上分析传入的短信?

安卓应用内结算 : Blank data received after purchase

ios - 我是否应该为我的应用程序的每种本地化语言添加新的应用程序内购买产品?