Ian Warburton
Ian Warburton

Reputation: 15676

Is it ok to repurpose SKPayment.applicationUsername?

Regarding SKPayment.applicationUsername, it says here...

This is used to help the store detect irregular activity. For example, in a game, it would be unusual for dozens of different iTunes Store accounts making purchases on behalf of the same in-game character.

The recommended implementation is to use a one-way hash of the user’s account name to calculate the value for this property.

This property is optional. So, am I allowed to use it for something else entirely? I want to use it to store details about the product that are not stored in iTunes.

Upvotes: 3

Views: 1285

Answers (1)

Jacob Eiting
Jacob Eiting

Reputation: 1004

SKPayment.applicationUsername is only used by Apple on the backend for fraud detection. They can use it to see if a single user is processing purchases on multiple devices, or processing purchases more rapidly than normal.

This value is unreadable except for on the payment you set it on, you aren't able to read SKPaymentTransaction.payment.applicationUsername it is always nil.

On a side note, I think this is a flaw in StoreKit as it makes it impossible to link transactions within an iTunes account to an application account, so if you have users sharing an iTunes account it is very difficult to not double grant purchased content.

Upvotes: 2

Related Questions