应用内结算v3:用户的SKU未找到 [英] In-app Billing v3: SKUs not found

查看:356
本文介绍了应用内结算v3:用户的SKU未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了应用内结算我的Andr​​oid应用程序,设置多个订阅。我使用的应用内结算的版本3,通过可通过/演员/谷歌/ play_billing /样本/ TrivialDrive的com.example.android.trivialdrivesample.util项目提供的实用程序类。

应用程序是建立在以下权限:

  com.android.vending.CHECK_LICENSE
com.android.vending.BILLING
android.permission.WRITE_EXTERNAL_STORAG​​E
android.permission.INTERNET对

我创建了产品的应用和激活他们在谷歌Play开发者控制台。现在他们已经活跃了超过一个星期。

应用程序发表在量产版,以及最新的APK上传到开发者控制台。这也得到这样的时间长度相同。

使用IABHelper类,我没有收到任何异常,但是当我抬头看SKU的细节,它不能找到它。

我发现,当我打开了IABHelper类的调试日志,我得到以下日志:

 启动应用内结算设置。
结算服务连接。
检查应用内结算3支持。
应用内结算3版支持com.testbank.app.act_full
订阅可用。
应用内结算设置OK
安装成功。 (回应:0:OK)
启动异步操作:刷新库存
查询拥有项目,项目类型:应用程式内
包名称:com.testbank.app.act_full
调用与延续标记getPurchases:空
自备物品回应:0
延续标记:空
查询SKU的细节。
queryPrices:无事可做,因为没有单品。

这似乎表明,应用程式内计费设置正确,但找到任何产品的应用。

另外,我增加了我自己的日志输出,正在检索skudetails的总数,发现它是没有。

我已经证实,包名,公共密钥和SKU都在谷歌Play开发者控制台,它们各自的值相匹配。

我已经提交了这个问题,以谷歌Play开发者的支持,但在此之前,我希望可以有一些额外的东西,我可以在我结束做些什么来解决这个问题。


解决方案

您需要发送的SKU列表,而你查询库存如下图所示。

 的ArrayList<串GT; skuList =新的ArrayList<串GT; ();
skuList.add(premiumUpgrade);
skuList.add(气);
捆绑querySkus =新包();
querySkus.putStringArrayList(ITEM_ID_LIST,skuList);

添加列表之后打谷歌Play商店检索有关产品的详细信息。

 捆绑skuDetails = mService.getSkuDetails(3,
getPackageName(),应用程式内,querySkus);


  1. ,并确保您是否正确添加了公共密钥。

  2. 无论您使用的是签署的APK。

  3. 您正在测试应该saame作为上传到店里一APK版本。

  4. 一旦上传需要3-5小时在谷歌服务器进行更新。可能是你可以上传一些小时后再试。

您可以按照的Andr​​oid文档为分步实施的过程版本3计费。

I have set up in-app billing on my android application, to set up several subscriptions. I am using in-app billing version 3, with the utility classes offered through the com.example.android.trivialdrivesample.util project available through /extras/google/play_billing/samples/TrivialDrive.

The app is set up with the following permission:

com.android.vending.CHECK_LICENSE
com.android.vending.BILLING
android.permission.WRITE_EXTERNAL_STORAGE
android.permission.INTERNET

I have created the products for the application and activated them in the google play developer console. They have now been active for well over a week.

The application is published in production version, and latest apk is uploaded to the developer console. This has also been this way for the same length of time.

Using the IABHelper class, I was not receiving any exceptions, but When I look up the sku details, it can not find it.

I found that when I turn on the Debug logs for IABHelper class, I get the following logs:

Starting in-app billing setup.
Billing service connected.
Checking for in-app billing 3 support.
In-app billing version 3 supported for com.testbank.app.act_full
Subscriptions AVAILABLE.
In-app Billing is set up OK
Setup successful. (response: 0:OK)
Starting async operation: refresh inventory
Querying owned items, item type: inapp
Package name: com.testbank.app.act_full
Calling getPurchases with continuation token: null
Owned items response: 0
Continuation token: null
Querying SKU details.
queryPrices: nothing to do because there are no SKUs.

This appears to indicate that inapp billing is set up correctly but is finding any products for the application.

In addition, I added my own logs to output the total number of skudetails that were being retrieved, and found that it was none.

I have confirmed that the package name, public key and skus all match their respective values in the google play developer console.

I have submitted this issue to Google Play Developer Support but in the meantime, I was hoping that there may be some additional things I could do on my end to address the issue.

解决方案

You need to send the list of SKU's while you querying the Inventory as below.

ArrayList<String> skuList = new ArrayList<String> ();
skuList.add("premiumUpgrade");
skuList.add("gas");
Bundle querySkus = new Bundle();
querySkus.putStringArrayList("ITEM_ID_LIST", skuList); 

after adding the list hit google play store for retrieving details about products.

Bundle skuDetails = mService.getSkuDetails(3, 
getPackageName(), "inapp", querySkus);

  1. And ensure whether you have added the public key correctly .
  2. Whether you are using the signed APK.
  3. APK version that you are testing should be saame as the one that was uploaded to the store.
  4. Once it uploaded it takes 3-5 hours for updating in the google server. May be you can try after some hours of upload.

you can follow step by step procedure in Android Docs for implementing version 3 billing.

这篇关于应用内结算v3:用户的SKU未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆