SKMutablePayment property: applicationUsername

后端 未结 1 605
再見小時候
再見小時候 2020-12-08 12:32

I am implementing In App Purchases in my app and I am using Non-Consumable Products. I have User Login in my application and to prevent Irregular Activity apple sugests to

相关标签:
1条回答
  • 2020-12-08 12:52

    After a lot of research i found that we can't use applicationUsername for this purpose.

    For a restoreCompletedTransaction you can use the transaction.originalTransaction.transactionIdentifier property (and it's equivalent under a new purchase - transaction.transactionIdentifier).

    That is a unique identifier associated with the Purchase itself and iTunes Account that is found in the restore record.

    1. How to use it:

    Record that Original transactionIdentifier on your server as associated with the original purchase by user A.

    2. Detect Irregular Activity

    If another user tries to restore their purchase check to be sure the transactionIdentifier has not already been used under a different userName.

    If this transactionIdentifier has not been been used from none of your users than make your restore successful. If the transactionIdentifier has already been used from another user than explain the user why you can't make the restore.

    This is essentially equivalent to using 'transaction.transactionIdentifier' as the 'applicationUsername'.

    0 讨论(0)
提交回复
热议问题