我正在使用 com.android.billingclient:billing:3.0.1 库。打开应用程序时如何检查用户是否购买了任何产品。所以我想在付款页面打开之前检查一下。
以下方法返回 null:
mBillingClient = BillingClient.newBuilder(getApplicationContext()).enablePendingPurchases().setListener(this).build();
mBillingClient.queryPurchaseHistoryAsync(BillingClient.SkuType.INAPP, new PurchaseHistoryResponseListener() {
@Override
public void onPurchaseHistoryResponse(@NonNull BillingResult billingResult, @Nullable List<PurchaseHistoryRecord> list) {
list.size();
}
});