简体   繁体   English

如何将应用内购买添加到Play商店中已发布的应用中,并在投入生产之前对其进行测试?

[英]How do I add in-app purchase to a published app in play store and test it before going into production?

Before asking this question, I have read the developer notes on android developers site and also watched the Google IO video. 在问这个问题之前,我已经阅读了android开发人员网站上的开发人员说明,还观看了Google IO视频。 I have also seen the question posted on SO. 我也看到了在SO上发布的问题 Since the question has been asked long ago and its answers are also pretty aged, it doesn't answer my doubts reason being Google has changed quite a few things related to In App Billing and its testing. 自从很久以前就问过这个问题,而且答案也已经很老了,它无法回答我的怀疑,原因是Google已经改变了许多与In App Billing及其测试有关的事情。

I am planning to add in app purchase to my app which I published long ago in play store. 我打算将购买的应用添加到我很久以前在Play商店中发布的应用中。 I wrote the code of in app billing V3 ytaking help from TrivialDrive example. 我从TrivialDrive示例中编写了应用内帐单V3获取帮助的代码。 I have few doubts on how do I proceed further for testing: 我对如何进一步进行测试几乎没有疑问:

[Question] [题]

  1. I have read that I should upload the new apk which includes in app billing code and permission to play store's in-app products . 我已经读过我应该上传新的apk,其中包括应用帐单代码和播放商店的in-app products权限。 Won't that make the upgrade available to all the users using previous version of app? 这是否会使使用旧版应用程序的所有用户都能使用升级? Once I upload the new apk with in app billing feature, it would replace the older apk in production, right? 一旦我上传了带有应用内结算功能的新apk,它将取代生产中的旧apk,对吗? If yes, how do I make sure the upgrade goes to production only when I am done with testing? 如果是,我如何确保仅在完成测试后才能将升级投入生产?
  2. When I click on button for in-app purchase, it displays an alert dialog with following error: 当我单击应用内购买按钮时,它将显示一个警告对话框,并显示以下错误:
    Authentication is required. You need to sign in to your Google Account.

You can upload it to the Alpha or Beta channels first. 您可以先将其上传到Alpha或Beta频道。 Add yourself as a test user so you'll be able to make test purchases. 将您自己添加为测试用户,这样您就可以进行测试购买。 When the version on the Beta channel will be ready, you can make it the production version. 当Beta通道上的版本准备就绪时,您可以将其设为生产版本。

If you choose to upload it to the production, you can choose not to publish it, but save it as draft, and you'll be able to test it. 如果您选择将其上传到产品中,则可以选择不发布它,而是将其另存为草稿,然后就可以对其进行测试。

Authentication is required. 需要验证。 You need to sign in to your Google Account error comes when you have not downloaded the app from playstore(ie you are testing via IDE). 如果您尚未从Playstore下载该应用程序(即您正在通过IDE进行测试),则需要登录Google帐户时会出现错误消息。

You can test in app purchases via alpha beta channels from your dev console as told by Udi I. 您可以按照开发者控制台的指示,通过开发者控制台通过alpha beta渠道测试应用购买。

Additional points:- 其他要点:

Keep in mind that for every real/succesful transaction/purchase Google takes 30% of the fee. 请记住,对于每笔真实/成功的交易/购买, Google都会收取30%的费用。

You can re-imburse/cancel the transaction to the user in the first 15 minutes. 您可以在前15分钟内向用户重新支付/取消交易。

User can restore the purchases within 15 Minutes, or the in app purchase amount credited to you will get deducted if the user immediately un-installs the app after doing the transaction. 用户可以在15分钟内恢复购买,否则,如果用户在完成交易后立即卸载了该应用,则该应用中的购买金额将被扣除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM