gpt4 book ai didi

ios - SKMutablePayment 属性 : applicationUsername

转载 作者:可可西里 更新时间:2023-11-01 03:28:04 31 4
gpt4 key购买 nike

我正在我的应用中实现应用内购买,并且我正在使用非消耗性产品。我的应用程序中有用户登录,为了防止不规则事件,苹果建议使用 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/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com