使用 Android 计费库在一笔交易中购买多个商品/多个商品数量
根据Android计费库v4.0+的文档,谷歌添加了购买多数量商品的功能。
我在 Play 管理中心启用了该选项: https://i.sstatic.net/OQ6OA.png
但不幸的是,对话框不会让我选择数量:
https://i.sstatic.net/OQEzA.png
调用代码如下所示:
billingClient.querySkuDetailsAsync(params.build(),
new SkuDetailsResponseListener() {
@Override
public void onSkuDetailsResponse(BillingResult billingResult,
List<SkuDetails> skuDetailsList) {
Log.d(TAG, "billingDebug: size" + skuDetailsList.size());
if (skuDetailsList.size() > 0){
BillingFlowParams billingFlowParams = BillingFlowParams.newBuilder()
.setSkuDetails(skuDetailsList.get(0))
.build();
String responseCode = billingClient.launchBillingFlow(DetailActivity.this, billingFlowParams).toString();
Log.d(TAG, "billingDebug: response: " + responseCode);
}
}
});
如何使用计费库购买多个 SKU/单个 SKU 的多个数量? 任何帮助将不胜感激。提前致谢。
According to the documentation of Android billing library v4.0+, google has added the ability to purchase multi-quantity of an item.
I enabled the option in Play Console:
https://i.sstatic.net/OQ6OA.png
But unfortunately the dialog won't allow me to select quantity:
https://i.sstatic.net/OQEzA.png
the invoking code looks like this:
billingClient.querySkuDetailsAsync(params.build(),
new SkuDetailsResponseListener() {
@Override
public void onSkuDetailsResponse(BillingResult billingResult,
List<SkuDetails> skuDetailsList) {
Log.d(TAG, "billingDebug: size" + skuDetailsList.size());
if (skuDetailsList.size() > 0){
BillingFlowParams billingFlowParams = BillingFlowParams.newBuilder()
.setSkuDetails(skuDetailsList.get(0))
.build();
String responseCode = billingClient.launchBillingFlow(DetailActivity.this, billingFlowParams).toString();
Log.d(TAG, "billingDebug: response: " + responseCode);
}
}
});
How can i use the billing library to purchase multiple SKUs / multi quantity of a single SKU?
Any help would be appreciated. Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无法手动设置数量。它由 Play 商店管理。用户可以在结帐时选择数量。
There is no way to set the quantity manually. It is managed by Play Store. Users can select the quantity at checkout time.