本参考文档包含了 PurchasesUpdatedListener 的详情和相关的 OnPurchasesUpdated 公共方法。
public interface PurchasesUpdatedListener
gg.now.billingclient.api.PurchasesUpdatedListener
PurchasesUpdatedListener 是用于更新使用now.gg计费服务的应用内购买的监听器接口。
abstract void onPurchasesUpdated(int billingResult, List<Purchase> purchases)
// 用于获取购买更新通知的方法
void onPurchasesUpdated (int billingResult, List<Purchase> purchases)
onPurchasesUpdated 方法的实现用于启用购买更新的通知。包含了以下两种购买:
注意:此处报告的购买应被消费。
| 参数 | 描述 |
|---|---|
| billingResult | 购买结果通过返回值来更新。如果用户已拥有该物品,返回值为 7。如果物品不可用,返回值为 4。如果用户取消购买流程,返回值为 1。 |
| purchases | 更新的购买列表 |