ios - 由于 SKOverlay.AppConfiguration,Apple 硅 Mac 支持问题
问题描述
我的应用使用 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
我认为 SKOverlay.AppConfiguration 不存在于硅 Mac 上。根据“构建通用 macOS 二进制文件”,我添加了一些宏并且代码仅在 iOS 中运行,但错误仍然存在。有什么建议么?
#if !targetEnvironment(macCatalyst) && os(iOS)
Button(action: { showRecommendedApp.toggle() }) { Text("App recommended".localized)
.appStoreOverlay(isPresented: $showRecommendedApp) {
SKOverlay.AppConfiguration(appIdentifier: "12345", position: .bottom)
}
#endif
解决方案
M1 Mac 可以直接运行 iOS 二进制文件,它们不需要 Mac Catalyst 构建。
您不能在编译时使用#if 来测试 M1,因为它是在 iOS 和 M1 Mac 上运行的相同二进制文件。
您可以使用运行时检查isiOSAppOnMac
。
if !ProcessInfo.processInfo.isiOSAppOnMac {
Button ...
}
您仍然会收到警告,但您知道它将在运行时正确处理。
推荐阅读
- html - 外部 CSS !important 覆盖内联 !important
- r - ggplot 绘制变量组的平均值
- java - 插入时Android ArrayAdapter崩溃
- javascript - 如何在 react-js 中将 js 对象的值共享给 sass 变量?
- docker - docker compose - 外部属性在网络下意味着什么?
- bitmask - 如何确定此位掩码代码在做什么
- python - 为自定义数据集创建 YOLO 权重文件
- android - Android - 在 RecyclerView 中管理变量 RadioGroups 的最佳方式
- node.js - Node.js gRPC 与工具 proto 文件的连接
- pyspark - Spark-submit AWS EMR with anaconda 安装的 python 库