0

我有以下情况:

  1. 我有一些想要出售的物品
  2. 用户购买了该商品,并标记为“已购买”。现在用户可以下载文件了。
  3. 用户按下“下载”按钮并下载文件(它必须是一些唯一的链接)

我阅读了所有应用内计费文档,第 1 步和第 2 步对我来说很好。如何在 android 端实现第 3 步?

我想这是这样的:

  1. 应用程序将产品 ID 发送到我的服务器
  2. 我的服务器以随机数响应
  3. 我将此 nonce 和产品 ID 发送到 Google Play
  4. Google Play 向我返回一张签名票(nonce 和产品 ID)
  5. 我将此签名票发送到我的服务器
  6. 我的服务器返回应用程序的文件

目前我只能处理购买状态发生变化的信息,但如果我先购买该项目,然后再安全下载它怎么办。

4

1 回答 1

0

The user can definitely download the file at a later point in time. There are two ways to approach this:

Managed Purchases

A managed purchase is a one-time in-app billing purchase. These kinds of purchases would be for things like permanent access to content or permanent upgrades to an app (think "pro" versions). If your purchase is a managed purchase (which means the Google servers always know about the purchase) then you can follow your steps 1-6 at any point in time, allowing the user to download the file at their convenience.

Unmanaged Purchases

An unmanaged purchase is for things like video game money, where you want the user to be able to make the purchase multiple times. Unmanaged purchases need to be handled by your servers and cannot involve Google Services after the transaction has been completed. In this case, you register the purchase with your server, and then afterwards you can allow the user to download the file at any point in time simply by authenticating them with your server.

Let me know if you have any additional questions and I would be happy to help.

于 2012-10-29T14:41:13.640 回答