gpt4 book ai didi

google-play - Google Play应用内结算-列出购买

转载 作者:行者123 更新时间:2023-12-02 09:40:05 26 4
gpt4 key购买 nike

我希望获得我已购买但尚未消费的应用内购买 list 。

Google Play是否提供此类API?

最佳答案

https://developer.android.com/google/play/billing/billing_integrate.html#QueryPurchases

Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null);
int response = ownedItems.getInt("RESPONSE_CODE");
if (response == 0) {
ArrayList<String> ownedSkus =
ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST");
ArrayList<String> purchaseDataList =
ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST");
ArrayList<String> signatureList =
ownedItems.getStringArrayList("INAPP_DATA_SIGNATURE_LIST");
String continuationToken =
ownedItems.getString("INAPP_CONTINUATION_TOKEN");

for (int i = 0; i < purchaseDataList.size(); ++i) {
String purchaseData = purchaseDataList.get(i);
String signature = signatureList.get(i);
String sku = ownedSkus.get(i);

// do something with this purchase information
// e.g. display the updated list of products owned by user
}

// if continuationToken != null, call getPurchases again
// and pass in the token to retrieve more items
}

关于google-play - Google Play应用内结算-列出购买,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40549463/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com