- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在我的应用中实现应用内购买,并且我正在使用非消耗性产品。我的应用程序中有用户登录,为了防止不规则事件,苹果建议使用 applicationUsername 属性,这样我就可以随付款一起发送用户的用户名。
一切正常,我可以设置 payment.applicationUsername 属性,我可以在购买完成后以 SKPaymentTransactionStatePurchased 状态取回它。
问题是,当我尝试使用 restoreCompletedTransactionsWithApplicationUsername: 方法恢复我的事务时,applicationUsername 属性返回 NULL。
你能帮帮我吗?
最佳答案
经过大量研究,我发现我们不能为此目的使用applicationUsername。
对于 restoreCompletedTransaction,您可以使用 transaction.originalTransaction.transactionIdentifier 属性(在新购买下它是等效的 - transaction.transactionIdentifier)。
这是一个唯一标识符,与在恢复记录中找到的购买本身和 iTunes 帐户相关联。
<强>1。使用方法:
Record that Original transactionIdentifier on your server as associated with the original purchase by user A.
2。检测异常事件
If another user tries to restore their purchase check to be sure the transactionIdentifier has not already been used under a different userName.
如果您的任何用户都没有使用过此事务标识符,则恢复成功。如果 transactionIdentifier 已被其他用户使用,请向用户解释您无法进行恢复的原因。
This is essentially equivalent to using 'transaction.transactionIdentifier' as the 'applicationUsername'.
关于ios - SKMutablePayment 属性 : applicationUsername,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25480869/
我正在我的应用中实现应用内购买,并且我正在使用非消耗性产品。我的应用程序中有用户登录,为了防止不规则事件,苹果建议使用 applicationUsername 属性,这样我就可以随付款一起发送用户的用
关于 SKPayment.applicationUsername,它说 here ... This is used to help the store detect irregular activit
在 WWDC 视频“使用 Store Kit 进行应用内购买”中,演讲者描述了添加 payment.applicationUsername 作为客户帐户名称的哈希值。 payment.applicat
在苹果的文档中,它说开发者可以使用applicationusername 来Detecting Irregular Activity ,但我不知道如何使用它。文档只是说散列一个userId,但我如何检
我是一名优秀的程序员,十分优秀!