如何在应用内结算交易中检索客户的电子邮件?
随 PURCHASE_STATE_CHANGED 意图返回的 JSON 字段 包含非常有用的信息,但我感兴趣的一项没有列出:客户的电子邮件地址。
有没有办法使用 In-App Billing API 来检索它?
如果没有,是否有办法检索客户的其他唯一标识符,以便交易可以与客户而不是设备关联?
The JSON fields that are returned with a PURCHASE_STATE_CHANGED intent contain very useful information, but one piece that I am interested in is not listed: customer's email address.
Is there a way to retrieve it, using In-App Billing API?
If not, is there a way to retrieve some other unique identifier for the customer, so that a transaction can be associated with the customer, not the device?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您运行的是 Android 2.x 及更高版本,也许您可以使用所有者的电子邮件地址?
这样做的缺点是它需要清单中的
android.permission.GET_ACCOUNTS
。您的应用程序需要的权限越多,您就越有可能吓到应用程序的潜在用户...另请注意,“所有者的电子邮件地址”可能与“购买帐户电子邮件地址”不同(特别是因为 蜂窝3.0)
If you are running Android 2.x and up, maybe you can get a way with the owner's email address?
The downside of this is that it requires
android.permission.GET_ACCOUNTS
in the manifest. The more permissions your apps requires, the more likely you are to scare prospective users of your app...Also note that "owner's email address" might not be the same as "purchase account email address" (especially since Honeycomb 3.0)
我也在努力解决这个问题。所以我想到的是使用随机数值。理想情况下,您应该在从应用程序发送应用内计费请求之前在服务器端生成随机数,因此在这种情况下,您可以将随机数值连接到客户的电子邮件。
我知道这有点笨拙,所以如果有人知道更好的解决方案,我希望看到它。
I was struggling to solve this problem too. So what I've come to is using nonce value. Ideally you should generate nonce on the server side prior to sending IN-APP Billing request from your app, so in this case you can connect nonce value to customer's email.
I understand that it's a little bit clunky so if anyone knows better solution I'd like to see it to.