简体   繁体   English

BillingClient Purchase.getProducts() 返回多个标识符

[英]BillingClient Purchase.getProducts() returns multiple identifiers

Previously, to get the product id , the getSku() method was used, which returned singular value.以前,为了获取产品id ,使用了getSku()方法,该方法返回奇异值。

In the 4.0.0 version of the BillingClient library, the getSkus() method was added ( https://developer.android.com/google/play/billing/release-notes#4-0 )在 4.0.0 版本的 BillingClient 库中,添加了getSkus()方法( https://developer.android.com/google/play/billing/release-notes#4-0

In version 5.0.0, the getSku() method was removed totally, and getSkus() was replaced with getProducts() , whose documentation says just “Returns the product Ids.”在 5.0.0 版本中, getSku()方法被完全删除, getSkus()被替换为getProducts() ,其文档仅显示“返回产品 ID”。 ( https://developer.android.google.cn/reference/com/android/billingclient/api/Purchase?hl=zh-cn#getProducts() ) ( https://developer.android.google.cn/reference/com/android/billingclient/api/Purchase?hl=zh-cn#getProducts() )

I cant google any information, why product can have multiple identifiers now?我无法谷歌任何信息,为什么产品现在可以有多个标识符?

Since v5.0.0 BillingFlowParams.Builder has setProductDetailsParamsList() method which indicates there can be multiple products included within one purchase, so to be consistent with this Purchase has the getProducts() method which returns a list.由于 v5.0.0 BillingFlowParams.Builder具有setProductDetailsParamsList()方法,该方法指示一次购买中可以包含多个产品,因此为了与此一致,此Purchase具有返回列表的getProducts()方法。

(The sample code uses ImmutableList but with only a single item: https://developer.android.com/google/play/billing/integrate#launch ) (示例代码使用ImmutableList但只有一个项目: https://developer.android.com/google/play/billing/integrate#launch

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 RuntimeException:在应用内购买中调用 BillingClient 函数时 - RuntimeException : when calling BillingClient function in in app purchase 应用程序购买中的 Android:BillingClient:getPurchase() 失败。 响应码:3 - Android in app purchase: BillingClient: getPurchase() failed. Response code: 3 Android - BillingClient 返回空购买列表 - Android - BillingClient returns empty purchases list BillingClient 始终返回 SERVICE_DISCONNECTED - BillingClient always returns SERVICE_DISCONNECTED 在完成inapp购买后,billingclient.querypurchase()。getPurchaseList()返回null - After completion of inapp purchase billingclient.querypurchase().getPurchaseList() is returning null BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED:并重新验证购买 - BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED: and revalidation of the purchase BillingClient.BillingClientStateListener.onBillingSetupFinished 被多次调用 - BillingClient.BillingClientStateListener.onBillingSetupFinished is called multiple times 使用 Android BillingClient 2.1 检索应用内购买,返回空列表 - Retrieve in-app purchases with Android BillingClient 2.1, returns empty list 退款客户应用程序内购买,但BillingClient仍然表明用户已购买? - Refund customer in-app purchase but BillingClient still indicate user has purchased? BillingClient的queryPurchases可以为我提供有关应用内购买所有权的可靠陈述吗? - Can BillingClient's queryPurchases give me a reliable statement about the ownership of an in app purchase?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM