[英]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.