我的应用使用appStoreOverlay显示推荐的应用,但提交到应用商店时出错。
ITMS-90863: Apple silicon Macs support issue - The app uses symbols that are not present on Mac:
/System/Library/Frameworks/_StoreKit_SwiftUI.framework/_StoreKit_SwiftUI
_$s7SwiftUI4ViewP010_StoreKit_aB0F03appD7Overlay11isPresented13configurationQrAB7BindingVySbG_So22SKOverlayConfigurationCyctRQOMQ我认为在silicon上没有SKOverlay.AppConfiguration。根据'Building a Universal macOS Binary',我添加了一些宏,代码只在iOS中运行,但错误仍然存在。有什么建议吗?
#if !targetEnvironment(macCatalyst) && os(iOS)
Button(action: { showRecommendedApp.toggle() }) { Text("App recommended".localized)
.appStoreOverlay(isPresented: $showRecommendedApp) {
SKOverlay.AppConfiguration(appIdentifier: "12345", position: .bottom)
}
#endif发布于 2021-02-22 13:35:55
Macs可以直接运行iOS二进制文件,它们不需要Macs构建。
你不能在编译时使用#if来测试M1,因为它是在iOS和M1 Mac上运行的相同的二进制文件。
您可以使用isiOSAppOnMac的运行时检查。
if !ProcessInfo.processInfo.isiOSAppOnMac {
Button ...
}您仍然会收到警告,但您知道它将在运行时正确处理。
https://stackoverflow.com/questions/66310312
复制相似问题