测试的Andr​​oid在应用程序内结算实际购买 [英] Testing Android In App Billing real purchases

查看:201
本文介绍了测试的Andr​​oid在应用程序内结算实际购买的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪些条件适当地测试实际的购买,当我已经测试了使用测试产品我的应用程序,比如 android.test.purchased

解决方案

有你需要通过几个步骤,记住,他们中的一些需要一些时间来更新谷歌播放服务器。

在这个例子中,我们使用 com.example.product 作为我们真正的产品ID。任何时候,它显示了在这个例子中,更改为自己。

上传APK文件

  

您的不能测试REAL在调试模式下采购。您需要下载从Beta的应用程序,因此谷歌知道,它的确定进行购买的应用程序。

  1. 检查您是否有计费的权限的Andr​​oidManifest.xml

     <使用-权限的Andr​​oid:名称=com.android.vending.BILLING/>
     

  2. 修改 android.test.purchased com.example.product

  3. 导出*的.apk文件。它的必须登录
  4. 在Beta版发布APK,
  5. 您现在可以进入下一个步骤,但你会需要一些时间,你的Beta要准备好下载。

添加新产品

  

您的不能添加新的产品,直到您已经发布了测试版。

     

不能测试订阅,只产品。现在,您可以也考验订阅(不续展每天24小时)

  1. 转至产品部分在谷歌Play开发者控制台,
  2. 点击添加新产品按钮并用 com.example.product 身份证,
  3. 定义新产品
  4. 在等待的几个小时,直到它的出版。

测试仪

  

您的不能购买测试签字,在一个开发者账户您的设备上。您不能从自己进行采购。

  1. 创建在谷歌论坛,或谷歌加,
  2. 测试组
  3. 添加您的测试者的Gmail帐户,该组,
  4. 设置您的组作为测试人员在谷歌Play开发者控制台> APP> BETA
  5. 复制测试人员的电子邮件谷歌Play开发者控制台>设置>执照考场 - 这会让启用了自己的账户购买测试

测试

  

作为测试者,您不会收取

当从下载的应用程序测试版,你会看到第一个IAP对话框中测试的信息。

您会看到开发控制台同时设置你的产品的名称和价格。

您将测试与你的真实的付款方式。不要害怕看到你的信用卡。正如我前面提到的 - 你将不会被收取

当你成功地进行测试购买,你会得到一个确认邮件,它看起来像一个真正的购买确认。

清洁试购

  

要重复相同的采购,你需要消耗产品,取消购买,或者干脆等待2周,待测试的购买将到期。

要取消采购:

  1. 作为一个开发者,去谷歌钱包,选择购买,并取消他们(记得来管理你的应用程序calceled购买),
  2. 作为测试者,进入应用程序管理您的设备上,并清除谷歌播放缓存。尽管取消对开发商的一面,你的设备在本地存储的购买信息。

What are the conditions to properly test real purchases, when i already have tested my app using test product like android.test.purchased?

解决方案

There are few steps that you need to pass, remembering, that some of them need some time to update on Google Play servers.

For this example, let's use com.example.product as our real product Id. Any time it shows up in this example change it to your own.

UPLOAD APK FILE

You CAN'T test REAL PURCHASES in DEBUG mode. You need to download an app from Beta, so Google know it's ok to make purchases in the app.

  1. Check if you have BILLING permission in AndroidManifest.xml:

    <uses-permission android:name="com.android.vending.BILLING" />
    

  2. Change android.test.purchased to com.example.product,

  3. Export *.apk file. It MUST BE SIGNED!
  4. Publish APK in Beta,
  5. You can now go to the next steps, but you'd need some time for your Beta to be ready for download.

ADD NEW PRODUCT

You CAN'T add new product until you have published a beta.

You CAN'T test subscriptions, only products. Now you CAN also test subscriptions (they are renewed every 24h)

  1. Go to products section in Google Play Developer Console,
  2. Click Add new product button and define new product with com.example.product Id,
  3. Wait FEW HOURS until it's published.

TESTERS

You CAN'T test purchases being signed-in on your device with a developer account. You CAN'T make purchases from yourself.

  1. Create testing group on Google Groups, or Google Plus,
  2. Add gmail accounts of your testers to that group,
  3. Set your group as testers in Google Play Developer Console > APP > BETA
  4. Copy testers emails in Google Play Developer Console > SETTINGS > LICENSE TESTING - this will make testing purchases enabled for their accounts.

TESTING

As a tester, you WON'T be charged

When testing from downloaded app Beta, you'll see a testing information on first IAP dialog.

You'll see both your product's name and price set in dev console.

You'll be testing with your real payment options. Don't be scared of seeing your credit card. As i mentioned before - you won't be charged.

When you successfully make a test purchase, you'll get a confirmation e-mail, which looks like a real purchase confirmation.

CLEANING TEST PURCHASES

To repeat the same purchases, you'll need to consume products, cancel purchases, or simply wait 2 weeks until testing purchases will expire.

To cancel purchases:

  1. As a Developer, go to Google Wallet, choose purchases, and cancel them (remember to manage calceled purchases in your app),
  2. As a Tester, go to app manager on your device, and clear Google Play cache. Despite of canceling on developer side, your device stores the purchase information locally.

这篇关于测试的Andr​​oid在应用程序内结算实际购买的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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