ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

android – 存储应用内购买的最佳方式

2019-06-12 15:10:37  阅读:177  来源: 互联网

标签:android in-app-billing


在我提出这个问题之前,我已经完成了Android In-App billing documentation,以及类似于this的StackOverflow上的一些类似问题.另外我猜这个问题可能会被关闭或者投票,因为它不是一个直接的编程问题,而且本质上是主观的.但是,它仍然存在.

实施工作正常.我的问题是在本地存储应用内购买的好方法.在我的情况下,只有一个一次性解锁项目可以解锁应用程序的全部功能,并且不会过期或被消耗.

共享偏好对于盗版来说似乎有点太容易了.即使查询Google Play工作正常并且看起来相对安全,它还可以依靠吗?由于文档建议以异步方式进行调用,因此支付解锁功能的用户可能不得不等待访问未锁定的功能并不是一个好主意.此外,当清除GP缓存时,它需要比平时更长的时间(这可能是一种罕见的情况).

但是看到有这么多的应用程序和开发人员,我想知道其他开发人员如何处理它?

解决方法:

实际上我认为你的问题会因为几个不同的原因而被关闭,但我会给你一些见解.

根据产品的性质以及其他一些方面,您可以选择一些选项.

>如果产品终身有效,或者取决于时间(对于instante,更新一年),您可以依赖谷歌播放,这可能是好的.
>如果产品是用户在应用程序内部以不同方式消费的东西,例如游戏内货币,额外生命等,则应将其保存在本地,sqlite数据库或远程数据库中(如果您愿意)使用服务器集中某些服务.

如果您查看指南purchase iab products的“消费购买”部分,您可以阅读:

Once an item is purchased, it is considered to be “owned” and cannot
be purchased again from Google Play while in that state. You must send
a consumption request for the item before Google Play makes it
available for purchase again. All managed in-app products are
consumable. How you use the consumption mechanism in your app is up to
you. Typically, you would implement consumption for products with
temporary benefits that users may want to purchase multiple times (for
example, in-game currency or replenishable game tokens). You would
typically not want to implement consumption for products that are
purchased once and provide a permanent effect (for example, a premium
upgrade).

对于消耗品:

It’s your responsibility to control and track how the in-app product
is provisioned to the user. For example, if the user purchased in-game
currency, you should update the player’s inventory with the amount of
currency purchased.

Security Recommendation: You must send a consumption request before
provisioning the benefit of the consumable in-app purchase to the
user. Make sure that you have received a successful consumption
response from Google Play before you provision the item.

无论如何,在任何范围内,我都建议跟踪用户购买的所有产品以及他自己拥有的所有权限,因为它更快,并且它可能对其他一些事情有用,如自定义统计,报告等.

标签:android,in-app-billing
来源: https://codeday.me/bug/20190612/1226568.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有