applicationUsername
A string that associates the transaction with a user account on your service.
Declaration
var applicationUsername: String? { get set }Mentioned in
Discussion
Consider assigning a UUID to the applicationUsername property. When this value is a UUID, the App Store server stores it as an appAccountToken. In this scenario, the following happens:
In the App Store Server API, the JWSTransactionDecodedPayload object returns the applicationUsername value in the appAccountToken field.
In App Store Server Notifications, the JWSTransactionDecodedPayload object returns the applicationUsername value in the appAccountToken field.
When you call the verifyReceipt endpoint to verify an App Store receipt, the App Store server returns the applicationUsername value in the app_account_token field of the responseBody.Latest_receipt_info.
The sample code below shows how to assign a UUID value to applicationUsername. You may choose to generate the UUID on your server. Assign the value before adding the payment to the payment queue.
If you don’t assign a UUID string value to applicationUsername, the App Store server doesn’t persist the value. The value won’t appear in the app_account_token fields in notifications or receipts.