Flutter / Swift Compiler Error (Xcode):在範圍內找不到"ExternalLinkAccount"



自2022年10月12日起,具有外部账户管理/购买功能的读者应用程序必须申报新的权利。

外部链接帐户允许符合条件的应用程序链接到外部网站以创建或管理帐户。https://developer.apple.com/documentation/storekit/external_link_account

我无法构建,因为:

Swift Compiler Error (Xcode): Cannot find 'ExternalLinkAccount' in scope
  1. 配置SKExternalLinkAccount属性列表键
<plist>
<dict>
<key>SKExternalLinkAccount</key>
<dict>
<key>*</key>
<string>https://example.com</string>
<key>jp</key>
<string>https://example.com/jp</string>
</dict>
</dict>
</plist>
  1. 转轮plist
<key>com.apple.developer.storekit.external-link.account</key>
<true/>
  1. 跑步者权利
<plist>
<dict>
<key>com.apple.developer.storekit.external-link.account</key>
<true/>
</dict>
</plist>
  1. ios构建(带有flutter运行(:
Swift Compiler Error (Xcode): Cannot find 'ExternalLinkAccount' in scope
  1. 自定义swift文件中的代码(使用特定于平台的调用调用(
import SwiftUI
struct ExternalLinkAccountModal: View {
var body: some View {
Text("Hello, world!")
.padding()
.onAppear {
Task {
await executeTask()
}
}
}
}
struct ExternalLinkAccountModal_Previews: PreviewProvider {
static var previews: some View {
ExternalLinkAccountModal(onConfirm: nil, onCancel: nil)
.previewDevice("iPhone 13")
.previewInterfaceOrientation(.portrait)
}
}

func executeTask() async {
let basicTask = Task {
if await ExternalLinkAccount.canOpen {
do {
try await ExternalLinkAccount.open()
} catch {
print("ExternalLinkAccount.open() error (error)")
}
}
}
}
  1. 配置文件我的配置文件配置良好,并被Apple Developper接受:
Associated Domains, External Link Account, In-App Purchase, Push Notifications

你能帮我解决这个问题吗?

我正在使用osx Ventura和ios16平台进行开发。

您可能需要:

import StoreKit

最新更新