简体   繁体   English

Android应用内结算错误

[英]Android In-App billing error

I have followed google instructions for implementing in-app purchases service. 我已按照谷歌指示实施应用内购买服务。

I was provided access to Google Play developer console as invited user. 我被邀请用户访问Google Play开发者控制台。 I took private key from it, and added my google account to the input field with test accounts. 我从中获取了私钥,并将我的Google帐户添加到带有测试帐户的输入字段。 After that I created APK file and signed it with valid certificate. 之后我创建了APK文件并使用有效证书进行了签名。 Then uploaded application to Google Play but didn't publish it. 然后将应用程序上传到Google Play但未发布。 After it I created needed in-app purchases and published them. 之后,我创建了所需的应用内购买并发布了它们。 Then installed same signed apk file on my device. 然后在我的设备上安装了相同的签名apk文件。

Right after publishing in-app purchases and for some period of time my application was giving me message like "not found", but some time later it became available. 在发布应用程序内购买之后,在一段时间内,我的应用程序给了我“未找到”这样的消息,但是一段时间之后它就变得可用了。 And now I can buy all the items from the application, but no one else who installed the same APK file can't. 现在我可以从应用程序中购买所有项目,但没有其他人安装相同的APK文件不能。 I tried to add their email addresses into list of test accounts in profile - no luck, even the user owner of the Google Play account can't buy anything. 我尝试将他们的电子邮件地址添加到个人资料中的测试帐户列表中 - 没有运气,即使是Google Play帐户的用户所有者也无法购买任何东西。 They keep receiving something like "item you selected is not available for purchase" When they try to buy test purchase item (the one that is described in documentation) they can successfuly get "android.test.purchased: PURCHASED" 他们继续收到诸如“你选择的商品无法购买”之类的东西当他们试图购买测试购买商品(文档中描述的商品)时,他们可以成功获得“android.test.purchased:PURCHASED”

Google Play takes a pretty long time to update its servers. Google Play需要相当长的时间来更新其服务器。 When I was implementing in app billing the first time, I must have rewritten everything at least 50 times. 当我第一次在应用计费中实施时,我必须至少重写50次。 Nothing changed, except some 12 hours later it all started working magically. 什么都没有改变,除了大约12个小时后它们开始神奇地工作。 Most likely their server hasn't updated yet. 很可能他们的服务器还没有更新。 If you can use the test items correctly, then your implementation is likely fine, and you just need to wait for the servers to update. 如果您可以正确使用测试项目,那么您的实现可能很好,您只需要等待服务器更新。

Only the signed apk file that you uploaded in play store can be used to buy the in app product. 只有您在Play商店中上传的已签名apk文件才能用于购买应用内商品。 Did you give the in app id in the signed apk file before registering the in app id in play store.then only others can buy the item. 您是否在注册的apk文件中提供了in app id,然后在play store中注册了应用程序ID。然后只有其他人可以购买该项目。

as per the edit 根据编辑

see you have use android.test.purchase ri8 it is an test id when your make your app real your need to replace that with your own in-app id.Then you have a question how to obtain in-app id.its very simple after saving your app(not published) in draft there is an option to add the in app product for your app.click that option where you will see the app id in one of the field then fill the in app id and also set corresponding amount for your product and publish the in-app product not the app.Replace the android.test.purchase with your new id in the signed apk and wait for some time so that the server can update your changes. 看你已经使用android.test.purchase ri8它是一个测试ID当你的应用程序真正需要用你自己的应用内id替换它。然后你有一个问题如何获得应用程序内id.its非常简单在草稿中保存您的应用程序(未发布)后,可以选择为您的app.click添加应用程序产品,您将在其中一个字段中看到应用程序ID,然后填写应用程序ID并设置相应的金额对于您的产品并发布应用程序内的产品而不是app。使用您的新ID在已签名的apk中放置android.test.purchase并等待一段时间,以便服务器可以更新您的更改。

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

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