Android 如何从 Google Play 控制台获取产品列表
Android How to get product list from GooglePlay console
我正在我的产品中开发 Android 应用内结算。我想问你 如何获取我已经通过 Google play console 注册的所有产品。
这是 Google 播放的示例代码。
List additionalSkuList = new List();
additionalSkuList.add(SKU_APPLE);
additionalSkuList.add(SKU_BANANA);
mHelper.queryInventoryAsync(true, additionalSkuList, mQueryFinishedListener);
但是如果我把 additionalSkuList 什么都没有,它将 return 什么都没有。
我想知道我在 Google play console 的 In-app Products 中注册的所有产品,以便提前使用产品信息制作视图。
有人遇到同样的问题吗?任何人都知道解决它的方法吗?
你不能。好吧,我不知道。
基本上 mHelper.queryInventoryAsync(true, additionalSkuList, mQueryFinishedListener);
最终直接从 InAppBillingService.aidl
调用 getSkuDetails()
方法
/**
* Provides details of a list of SKUs
* Given a list of SKUs of a valid type in the skusBundle, this returns a bundle
* with a list JSON strings containing the productId, price, title and description.
* This API can be called with a maximum of 20 SKUs.
* @param apiVersion billing API version that the Third-party is using
* @param packageName the package name of the calling app
* @param skusBundle bundle containing a StringArrayList of SKUs with key "ITEM_ID_LIST"
* @return Bundle containing the following key-value pairs
* "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
* failure as listed above.
* "DETAILS_LIST" with a StringArrayList containing purchase information
* in JSON format similar to:
* '{ "productId" : "exampleSku", "type" : "inapp", "price" : ".00",
* "title : "Example Title", "description" : "This is an example description" }'
*/
Bundle getSkuDetails(int apiVersion, String packageName, String type, in Bundle skusBundle);
如果您在 additionalSkuList
中没有指定任何列表,那么您将不会得到任何返回结果。
简而言之,您只需知道(并列出)所有 SKU,然后将此列表放入查询中。
现在可以使用 Google Play Developer API(a.k.a。android-publisher
):
https://developers.google.com/android-publisher/
特别是 Inappproducts: list API:
List all the in-app products for an Android app, both subscriptions and managed in-app products.
我正在我的产品中开发 Android 应用内结算。我想问你 如何获取我已经通过 Google play console 注册的所有产品。
这是 Google 播放的示例代码。
List additionalSkuList = new List();
additionalSkuList.add(SKU_APPLE);
additionalSkuList.add(SKU_BANANA);
mHelper.queryInventoryAsync(true, additionalSkuList, mQueryFinishedListener);
但是如果我把 additionalSkuList 什么都没有,它将 return 什么都没有。
我想知道我在 Google play console 的 In-app Products 中注册的所有产品,以便提前使用产品信息制作视图。
有人遇到同样的问题吗?任何人都知道解决它的方法吗?
你不能。好吧,我不知道。
基本上 mHelper.queryInventoryAsync(true, additionalSkuList, mQueryFinishedListener);
最终直接从 InAppBillingService.aidl
getSkuDetails()
方法
/**
* Provides details of a list of SKUs
* Given a list of SKUs of a valid type in the skusBundle, this returns a bundle
* with a list JSON strings containing the productId, price, title and description.
* This API can be called with a maximum of 20 SKUs.
* @param apiVersion billing API version that the Third-party is using
* @param packageName the package name of the calling app
* @param skusBundle bundle containing a StringArrayList of SKUs with key "ITEM_ID_LIST"
* @return Bundle containing the following key-value pairs
* "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
* failure as listed above.
* "DETAILS_LIST" with a StringArrayList containing purchase information
* in JSON format similar to:
* '{ "productId" : "exampleSku", "type" : "inapp", "price" : ".00",
* "title : "Example Title", "description" : "This is an example description" }'
*/
Bundle getSkuDetails(int apiVersion, String packageName, String type, in Bundle skusBundle);
如果您在 additionalSkuList
中没有指定任何列表,那么您将不会得到任何返回结果。
简而言之,您只需知道(并列出)所有 SKU,然后将此列表放入查询中。
现在可以使用 Google Play Developer API(a.k.a。android-publisher
):
https://developers.google.com/android-publisher/
特别是 Inappproducts: list API:
List all the in-app products for an Android app, both subscriptions and managed in-app products.