Unable to set applicationUsername on SKPayment

I am following "What's New in StoreKit" from WWDC17 to set up payment for subscriptions in my app and the author of the talk recommends to set applicationUsername to an opaque user ID.

When I tried to set it, it turned out it is readonly. (iOS 15)

Is this still a recommended practice, to set that property on SKPayment?

Thanks

Accepted Answer

In order to mutate the applicationUsername or other properties of SKPayment, you must use its mutable subclass, SKMutablePayment.

Unable to set applicationUsername on SKPayment
 
 
Q