简体   繁体   English

生成兑换代码应用内结算

[英]Generate redeem code In-app billing

In my application the user should have the ability to buy a code that he is able to redeem on another device. 在我的应用程序中,用户应具有购买能够在另一台设备上兑换的代码的能力。 The problem with this is that In-app billing doesn't automatically generate a code for you. 问题在于应用内结算不会自动为您生成代码。 However, it does generate a purchase token. 但是,它会生成购买令牌。 I have come up with two possible solutions, but I don't know what to do. 我提出了两种可能的解决方案,但我不知道该怎么办。 Here are my options: 这是我的选择:

  1. Use an algorithm to make the purchase token shorter and use that as the code. 使用一种算法来缩短购买令牌,并将其用作代码。 (Not sure if this will have security concerns as the code may be redeems from another device.) (由于代码可能是从其他设备赎回的,因此不确定是否会有安全隐患。)
  2. Use a server and the Purchase Status to generate a code and manage the available and used codes. 使用服务器和购买状态生成代码并管理可用和已使用的代码。

This is very bold to implement something like this. 实现这样的东西非常大胆。 If you want to give users opportunity to give codes to others as a present, then you will need to have a server and keep your codes, as well as information on who and when redeemed it on the server. 如果您想让用户有机会将代码提供给其他人,那么您将需要拥有一台服务器并保存您的代码,以及有关在服务器上何时何地兑换代码的信息。 And this must be very secure and very reliable. 而且这必须非常安全且非常可靠。 This sounds as the option two. 这听起来像选项二。

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

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