2

我正在从https://github.com/serso/android-checkout lib 迁移到 com.android.billingclient.api,Checkout API 允许我通过提供开发负载作为参数来启动购买流程。如下图所示

    /**
     * @see #startPurchaseFlow(String, String, String, RequestListener)
     */
    public void startPurchaseFlow(Sku sku, @Nullable String payload, RequestListener<Purchase> listener) {
        startPurchaseFlow(sku, payload, null, listener);
    }

稍后我将能够在获取购买历史记录时检索相同的开发人员有效负载。

现在使用 com.android.billingclient.api 我看到我可以提供开发人员有效负载,查看我在com.android.billingclient.api 类的BillingClientImpl 中看到的代码,有效负载只是作为空值提供

futureBuyIntentBundle =
          executeAsync(
              new Callable<Bundle>() {
                @Override
                public Bundle call() throws Exception {
                  return mService.getBuyIntent(
                      /* apiVersion */ 3,
                      mApplicationContext.getPackageName(),
                      newSku,
                      skuType,
                      /* developerPayload */ null);
                }
              });

我想知道这是否是一个错误,或者还有另一种方法可以将开发人员有效负载存储在购买记录中。

4

1 回答 1

2

你是对的。Play 计费库在 2.0 之前的版本中不支持开发者负载。请参阅https://issuetracker.google.com/issues/69079764

从 2.0 开始,这被添加回来,但被移到消费/确认阶段: https ://developer.android.com/google/play/billing/billing_library_releases_notes#2_0_payload

于 2019-05-10T05:48:58.597 回答