如何在android上检查用户是否付款?
我想在我的 Android 应用程序中使用应用内计费(而不是创建 2 个版本的应用程序 - 免费版和专业版)。如果用户付费,则首选项中的其他选项应该可用。 我的应用程序与网站(不是我的)同步数据。 每次同步发生时,我想检查用户是否付费。 我该怎么做呢?
I would like to use in-app billing in my android application (instead of creation 2 versions of application - free and pro). If user paid, then additional options in Preferences should be available.
My application synchronizes data with website (not my).
Each time synchronization happens, I would like to check if user paid or not.
How should I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为对您来说最简单的方法是使用管理购买。有关更多信息,请访问 http://developer.android。 com/guide/market/billing/billing_admin.html#billing-purchase-type
更新:网站和 API 已更新,请立即参考此 https://developer.android.com/ google/play/billing/api.html
I think the easiest means for you would be to use Managed purchase. More on it is at http://developer.android.com/guide/market/billing/billing_admin.html#billing-purchase-type
Update: website and API updated refer this now https://developer.android.com/google/play/billing/api.html
有很多方法可以做到这一点,我将尝试为您提供一些最常用的
缺点是它需要更多处理,并且需要一些支持以防某人的帐户被盗或其他此类用户支持。
您可以在应用程序中保存某种密钥。以及服务器上的其他一些密钥。如果密钥匹配(1 对 1 或经过一些操作),那么您自己就是付费用户,否则您就没有。当有人购买该应用程序时,请更改设备上的密钥。
只做你不想做的事,并免费获得 2 个付费应用程序,这可能比上面列出的其他 2 个应用程序要少。
有很多方法可以做你想做的事。但我会告诉你:
大多数应用程序使用方法 2,但方向相反,即串行密钥。
我不认为你会创建一个 MMO,所以不需要选项 1,除非你真的不希望任何人破解你的应用程序(我认为无论你做什么,在当今世界都会被黑客攻击。我建议你相信那些支付并接受那些不这样做的人)
在我看来,方法 3 很简单,特别是当您只想删除菜单选项时,但它也会为代码创建重复的存储库。
祝你好运。你决定什么都好,做好防盗保护,如果有人想偷,他们会的,不要反抗(连PS3最后都被黑了)
There are to many ways to do that, i will try and give you some of the most used
the downside is that it requires more processing and some support is case someone's account gets stolen or other user support of that kind.
you can save a sort of key inside your application. and some other key on the server. if the key matches (either 1 to 1 or after some manipulation) then you have yourself a paid user, other you dont.when someone buys the application then change the key on the device.
just do what you dont want to do and have 2 applications for free and paid it will probably be less work then the other 2 list above.
there are many ways of doing what you want. but i'll tell you this:
most applications use method 2 but on the opposite direction, meaning serial key.
i dont think your gonna create an mmo so theres no need for option 1 unless you really dont want anyone hacking your application (which i assume no matter what you do it will be hacked in todays world. i'll advice you to trust those who pay and accept those who dont)
method 3 is just easy in my opinion especialy when you want to just remove menu options, but it also creates duplicate repositories for code.
good luck. what ever you decide is good, make a theft protection, if someone wants to steal it, they will, dont fight it (even PS3 got hacked in the end)