You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Siri快捷指令无法识别葡萄牙语人名(模拟器正常)

问题:App Shortcuts无法识别葡萄牙语人名(仅模拟器正常运行)
  • 巴西地区环境下,常规Siri可正常识别葡萄牙语人名,但在App Shortcuts中无法识别该类人名
  • 仅模拟器中可正常运行,已在运行iOS 17.2的iPhone 13 Pro真机上完成测试

相关代码(Swift)

struct Intents {
    @available(iOS 16, *)
    struct ShortcutsProvider: AppShortcutsProvider {

        static var appShortcuts: [AppShortcut] {
            AppShortcut(
                intent: ContactsIntent(),
                phrases: [
                    "Contato com \(.applicationName)"
                ],
                shortTitle: LocalizedStringResource("Falar")
            )
        }
    }
}

@available(iOS 16, *)
struct ContactsIntent: AppIntent {

    static var title: LocalizedStringResource = "Select contact"

    static var openAppWhenRun = true

    static var authenticationPolicy: IntentAuthenticationPolicy = .requiresAuthentication

    @Parameter(
        title: "Contacts",
        description: "Send to contacts",
        requestValueDialog: IntentDialog("Who is the contact?"),
        optionsProvider: ContactsectionsOptionsProvider()
    )
    var contact: String


    private struct ContactsectionsOptionsProvider: DynamicOptionsProvider {
        func results() async throws -> ItemCollection<String> {
            return ItemCollection {
                ItemSection(
                    items: DataStorage.contacts.map {
                        let name = $0.capitalized(with: .autoupdatingCurrent)
                        return IntentItem<String>.init(
                            name,
                            title: LocalizedStringResource(stringLiteral: name)
                        )
                    }
                )
            }
        }
    }

    @MainActor
    func perform() async throws -> some IntentResult {

        // This never is called

        return .result()
    }
}

struct DataStorage {
    // Communs names in Brazil
    static var contacts: [String] {
        [
            "Adriano",
            "Ricardo",
            "Bruno"
        ]
    }
}

内容的提问来源于stack exchange,提问作者MaatheusGois

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.05 07:05:59