所以我正在使用 android billing library 并有这个小设置:
BillingController.setConfiguration(new BillingController.IConfiguration() {
public byte[] getObfuscationSalt() {
//Havent changed this
return new byte[] { 41, -90, -116, -41, 66, -53, 122,
-110, -127, -96, -88, 77, 127, 115, 1, 73, 57,
110, 48, -116 };
}
public String getPublicKey() {
return "The key (yes this is set correctly)";
}
});
BillingController.setDebug(true);
mBillingObserver = new AbstractBillingObserver(this) {
public void onBillingChecked(boolean supported) {
BuyCoins.this.onBillingChecked(supported);
}
public void onPurchaseStateChanged(String itemId,
PurchaseState state) {
BuyCoins.this.onPurchaseStateChanged(itemId, state);
}
public void onRequestPurchaseResponse(String itemId,
ResponseCode response) {
BuyCoins.this.onRequestPurchaseResponse(itemId,
response);
}
public void onSubscriptionChecked(boolean supported) {
BuyCoins.this.onSubscriptionChecked(supported);
}
};
BillingController.registerObserver(mBillingObserver);
BillingController.checkBillingSupported(this);
BillingController.checkSubscriptionSupported(this);
}
然后简单地说:
public void onSubscriptionChecked(boolean supported) {
if (supported) {
Toast.makeText(this, "Subscription is supported", Toast.LENGTH_SHORT)
.show();
} else {
Toast.makeText(this, "Subscription is NOT supported", Toast.LENGTH_SHORT)
.show();
}
}
public void onRequestPurchaseResponse(String itemId, ResponseCode response) {
if (response == ResponseCode.RESULT_OK) {
Toast.makeText(this, "Purchase Response OK", Toast.LENGTH_LONG)
.show();
} else if (response == ResponseCode.RESULT_USER_CANCELED) {
Toast.makeText(this, "Purchase Response Canceled",
Toast.LENGTH_LONG).show();
} else if (response == ResponseCode.RESULT_SERVICE_UNAVAILABLE) {
Toast.makeText(this, "Purchase Response Unavailable",
Toast.LENGTH_LONG).show();
} else if (response == ResponseCode.RESULT_ERROR) {
Toast.makeText(this, "Purchase Response Error", Toast.LENGTH_LONG)
.show();
} else {
Toast.makeText(this, "UNKNOWN RESPONSE", Toast.LENGTH_LONG)
.show(); }
}
public void onPurchaseStateChanged(String itemId, PurchaseState state) {
Toast.makeText(this,
"Purchase State: " + state.toString() + " for item " + itemId,
Toast.LENGTH_LONG).show();
purchaseList();
}
public void onBillingChecked(boolean supported) {
if (supported) {
Toast.makeText(this, "Billing is supported", Toast.LENGTH_SHORT)
.show();
} else {
Toast.makeText(this, "Billing is NOT supported", Toast.LENGTH_SHORT)
.show();
}
}
并且该项目被称为:
public void onClick(View v) {
switch (v.getId()) {
case R.id.buy_coins_button_one:
BillingController.requestPurchase(this, "coins",true /* confirm */, null);
break;
case R.id.buy_coins_button_two:
BillingController.requestPurchase(this, "android.test.purchased",true /* confirm */, null);
break;
}
}
如果我点击按钮一(硬币),我会得到标题中提到的错误(“错误处理购买:[DF-BPA-13],然后我什至可以点击“接受并购买”
我到处检查过,似乎没有关于为什么会出现这个错误的明确答案。
如果我点击按钮二(保留的 android 按钮),我可以点击购买,但随后我得到:
从服务器检索信息时出错。[DF-DFERH-01]
所以这里有一些步骤来对抗这种胡说八道:
- 公钥是正确的
- 应用内商品已发布 1 天
- 在计费观察者上将调试设置为 true
- 应用程序已导出并使用密钥库签名,并安装了 apk
- 测试用户不是发布用户
- 测试用户在测试帐户列表中
- 调试被设置为关闭同样的问题
- 主要手机用户已更改(恢复出厂设置)为不同的测试用户
- 在不同用户的不同设备上测试
- APK 和 Market 上的版本和版本代码相同
我完全迷失在这里。也许值得注意的是还有另一个错误([27] 而不是1像其他错误):[27] FileBasedKeyValueStore.delete: Attempt to delete 'paramsnMy695NrbaHSHjK0hNnMgg' failed!
我在某处遗漏了什么吗?这一切似乎都非常简单。
我看过:
我会及时通知你我是如何解决的,因为这似乎是一个常规问题
编辑:因此您无法从开发控制台中删除应用程序,因此删除/添加不起作用。