I am implementing the new StoreKit 2 api code in my app and came across a weird bug that appears to be in the Apple code. I've simplified it down and can recreate in the SKDemo code with one line.
func requestProducts() async {
...
for product in storeProducts {
...
case .autoRenewable:
let monthlyPriceFormat = product.priceFormatStyle
..
}
Running this on either the iOS 15.5 simulator or a iOS 15.7 device causes a linker error on startup.
dyld[96041]: Symbol not found: _$s8StoreKit12BackingValueO5value9atKeyPath8sentinel9transformxSSd_xyXKxSgACXEtlF
Referenced from: /Users/aUser/Library/Developer/CoreSimulator/Devices/B3B66803-93C2-41A7-A700-B6AF78C6CB60/data/Containers/Bundle/Application/07BBCBFC-EFFD-41B7-8C69-209E44AA4D4D/SKDemo.app/SKDemo
Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/StoreKit.framework/StoreKit
Symbol not found: _$s8StoreKit12BackingValueO5value9atKeyPath8sentinel9transformxSSd_xyXKxSgACXEtlF
Referenced from: /Users/aUser/Library/Developer/CoreSimulator/Devices/B3B66803-93C2-41A7-A700-B6AF78C6CB60/data/Containers/Bundle/Application/07BBCBFC-EFFD-41B7-8C69-209E44AA4D4D/SKDemo.app/SKDemo
Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/StoreKit.framework/StoreKit
The Product priceFormatStyle instance property is supposed to be available in iOS 15.0+ but doesn't appear to be there. It works fine on iOS 16.0 simulator and devices. The subscriptionPeriodFormatStyle instance property appears to have the same issue.