【发布时间】:2013-09-07 22:36:00
【问题描述】:
我正在我的应用中实施应用内结算以解锁高级功能。 应用内结算设置正确。除了“开发人员有效负载”之外,一切似乎都很好。
示例应用说明
/*
* TODO: verify that the developer payload of the purchase is correct. It will be
* the same one that you sent when initiating the purchase.
*
* WARNING: Locally generating a random string when starting a purchase and
* verifying it here might seem like a good approach, but this will fail in the
* case where the user purchases an item on one device and then uses your app on
* a different device, because on the other device you will not have access to the
* random string you originally generated.
*
* So a good developer payload has these characteristics:
*
* 1. If two different users purchase an item, the payload is different between them,
* so that one user's purchase can't be replayed to another user.
*
* 2. The payload must be such that you can verify it even when the app wasn't the
* one who initiated the purchase flow (so that items purchased by the user on
* one device work on other devices owned by the user).
*
* Using your own server to store and verify developer payloads across app
* installations is recommended.
*/
示例应用使用空字符串作为开发人员有效负载。我的问题是使用什么字符串作为开发人员有效负载? 我可以使用用户的主电子邮件 ID 吗?
【问题讨论】:
-
查看此链接:stackoverflow.com/questions/17196562/…。我希望它能解决您的所有疑问。
-
谢谢毛利克。链接中的答案真的帮助了我:)
-
您应该关闭您的问题或在下面纠正我的答案以使问题得到解决,以便其他人可以根据需要检查此问题。
标签: android in-app-purchase in-app-billing android-billing