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
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'.