Android 应用内计费isBillingSupported-返回什么功能以及如何返回?
这个问题是围绕谷歌Android应用内计费服务提出的。具体而言,支持的是功能Android 应用内计费isBillingSupported-返回什么功能以及如何返回?,android,in-app-billing,Android,In App Billing,这个问题是围绕谷歌Android应用内计费服务提出的。具体而言,支持的是功能isbillings int result = mBillingService.isBillingSupported(3, mOwner.getPackageName(), "inapp") 首先,这个函数返回什么?这些文件在这方面秘密得令人难以置信: 成功时结果_OK(0),失败时相应的结果代码 这个问题似乎与账单是否得到支持无关。所有看起来具体的是,0是成功的。会有什么错误 其次,该函数检查什么以了解是否支持计费?
isbillings
int result = mBillingService.isBillingSupported(3, mOwner.getPackageName(), "inapp")
首先,这个函数返回什么?这些文件在这方面秘密得令人难以置信:
成功时结果_OK(0),失败时相应的结果代码
这个问题似乎与账单是否得到支持无关。所有看起来具体的是,0是成功的。会有什么错误
其次,该函数检查什么以了解是否支持计费?我有一部手机,完全可以进行应用内计费,当我连接到合理的互联网资源(如WiFi)时,该功能确实会返回“true”。然而,如果我的连接不太稳定,它将不会返回“true”。所以我假设它检查一个良好的连接。它还检查什么?其他响应代码为:-
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" }'
*/
- 结果\u OK=0-成功
- RESULT\u USER\u cancelled=1-用户按下或取消对话框
- 结果\u计费\u不可用=3-请求的类型不支持此计费API版本
- 结果\u项目\u不可用=4-请求的SKU不可购买
- RESULT\u DEVELOPER\u ERROR=5-提供给API的参数无效
- 结果_ERROR=6-API操作期间出现致命错误
- 结果\u项目\u已拥有=7-由于项目已拥有,无法购买
- RESULT_ITEM_NOT_OWNED=8-无法消费,因为ITEM NOT OWNED