我尝试通过com.android.billingclient:billing-dp1
库制作Google Play结算服务。我尝试通过调用以下方式开始结算过程:
billingClient.launchBillingFlow(activity, params);
所以问题是如何通过" developerPayload"这个流程的论点? launchBillingFlow
及其params
参数都不包含此类字段。
答案 0 :(得分:0)
你不能,如果你看一下BillingClientImpl
的来源,你会看到这个:
buyIntentBundle =
mService.getBuyIntent(3, mContext.getPackageName(), newSku, skuType, null);
最后null
是developerPayload
:
Bundle getBuyIntent(int apiVersion, String packageName, String sku, String type,
String developerPayload);
所以,还没有developerPayload
的实现。
答案 1 :(得分:0)
InitiatePurchase命令是否用于结算?因为您在InitiatePurchase命令中传递了developerPayload ...
string developerPayload = "the info you are passing in the developerPayload";
m_storeController.InitiatePurchase (product, developerPayload);
就是这样。
答案 2 :(得分:0)
最近我向开发者开了一个问题'页面,他们回答了以下问题:
我刚刚发现developerPayload
并不总是有效。在某些情况下,例如在使用促销代码时,稍后调用getPurchases()将不包含已发送的信息。这种限制使developerPayload
无用。谷歌的官方立场是它不应该用于安全目的,即使一堆文档和官方的Trivial Drive示例另有说法。希望这能为您节省一些时间。
查看详情here