我正在尝试启用应用程序计费。我已经在我的 Google Play 控制台上创建了应用内产品并获得了我的许可证密钥。当我尝试购买产品时。我收到此图像错误。
这是我用来创建 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 控制台的许可证密钥,MERCHANT_ID 为空。
这就是我购买物品的方式。
bp.purchase(this,PRODUCT_ID);
其中 PRODUCT_ID 是我在 Google Play 控制台中使用的 Product1,这是我的应用内产品的示例。
知道如何解决这个问题吗?只有一个 stackoverflow 问题与 DF-AA-20 问题没有答案。并且互联网上没有任何关于它的信息。我尝试过使用模拟器和我的安卓手机。