In app billing issue(应用内结算问题)
问题描述
我正在尝试在应用购买中实施,但几天来一直遇到问题.当用户尝试购买时,它是成功的,但应用程序给出了一个奇怪的错误,显然可以追溯到 os build honeycomb 阻止用户收到购买,直到他们再次点击购买按钮.
I am trying to implement in app purchasing and have had problems for days. When a user attempts to make a purchase it is successful but the app is giving an odd error that apparently dates back to os build honeycomb which prevents users from receiving the purchase until they click the buy button again.
步骤:
购买
购买成功
不提供消耗品
再次点击购买按钮
消耗品给定
这是我在未提供消耗品时遇到的错误:
日志标签:芬斯基
日志消息 [1] 1.run:缺少 inapp:com.mybillingproblem:one_chip 的交付数据
Log Message [1] 1.run: missing delivery data for inapp:com.mybillingproblem:one_chip
PID/TID:26927
PID/TID: 26927
代码:
public void oneChip(String noVal) {
Log.v("oneChip", "Calling launch purchase flow");
bp.purchase(this, itemOne);
Log.v("oneChip", "made it through launch purchase flow");
}
bp = new BillingProcessor(this, base64EncodedPublicKey,
new BillingProcessor.IBillingHandler() {
@Override
public void onBillingInitialized() {
Log.v("chip", "billing initialized");
readyToPurchase = true;
}
@Override
public void onProductPurchased(String productId,
TransactionDetails details) {
Log.v("chip", productId + " purchased");
if (bp.consumePurchase(productId)) {
if (productId == "itemOne"
|| productId == "one_chip")
ChipUpdate.updateChipCount(2500);
}
}
@Override
public void onBillingError(int errorCode, Throwable error) {
Log.v("chip", "Error code: " + errorCode);
Log.v("chip", "Error: " + error);
}
@Override
public void onPurchaseHistoryRestored() {
for (String sku : bp.listOwnedProducts())
Log.v("chip", "Owned Managed Product: " + sku);
for (String sku : bp.listOwnedSubscriptions())
Log.v("chip", "Owned Subscription: " + sku);
}
});
注意:我使用的是应用内计费 v3 jar.我不认为这是问题所在,因为它已被推荐并且似乎是常用的包装器.
Note: I am using the in app billing v3 jar. I don't think this is the issue though as it has come recommended and seems to be a commonly used wrapper.
谢谢!
推荐答案
你的Activity的onActivityResult()是什么样子的?你是否有一个?通常你将结果传递给 IabHelper 的 handleActivityResult
How does your Activity's onActivityResult() look like? Do you have one? Usually you pass the the result to to IabHelper's handleActivityResult
像这样:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
// Pass on the activity result to the iab helper for handling
if (!mHelper.handleActivityResult(requestCode, resultCode, data))
{
// not handled, so handle it ourselves (here's where you'd
// perform any handling of activity results not related to in-app
// billing...
super.onActivityResult(requestCode, resultCode, data);
}
}
这篇关于应用内结算问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:应用内结算问题
- 在 Iphone SDK 的导航栏上添加多个按钮 2022-01-01
- 使用自动布局向 UIScrollView 添加动态大小的视图 2022-01-01
- UITextView 内容插图 2022-01-01
- Xcode 7.3 中带有 UILabel 的 UIStackView 2022-01-01
- GPS状态的广播接收器? 2022-01-01
- 网上有没有好的 UIScrollView 教程? 2022-01-01
- URL编码Swift iOS 2022-01-01
- 如何在 iPhone 模拟器中重置 NSUserDefaults 数据? 2022-01-01
- SetOnItemSelectedListener上的微调程序错误 2022-01-01
- 类似于 Mail.app 的 iPad 模态视图控制器? 2022-01-01