该问题基于适用于Android的Google应用内结算服务。特别是函数isBillingSupported
。
int result = mBillingService.isBillingSupported(3, mOwner.getPackageName(), "inapp")
首先,这个函数返回了什么?这些文档非常隐秘:
成功时RESULT_OK(0),失败时对应的结果代码
only codes I found似乎与支持结算问题无关。所有看起来具体的,是0是成功的。有什么错误?
其次,该功能检查是否支持计费?我有一个完全能够进行应用程序内计费的手机,而且这个功能确实可以返回" true"当我连接到合理的互联网来源,如WiFi。但是,如果我的连接不稳定,它将不会返回" true"。所以我假设它检查一个良好的连接。还有什么检查?
答案 0 :(得分:6)
其他回复代码为: -
答案 1 :(得分:-3)
public int isBillingSupported(int apiVersion, java.lang.String packageName, java.lang.String type) throws android.os.RemoteException;
/**
* 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" : "$5.00",
* "title : "Example Title", "description" : "This is an example description" }'
*/