我正在从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);
}
});
我想知道这是否是一个错误,或者还有另一种方法可以将开发人员有效负载存储在购买记录中。