Die*_*rro 5 iphone ios siri swift sirikit
我在我的 iOS 应用程序中使用 Sirikit 实现了两个自定义意图。当我开发它们时,我的 iphone 中安装了 iOS 13.3,我的一个意图有一个 Siri Dialog 提示,要求输入一个参数的值。所有应用程序都被翻译成英语和西班牙语,并且自定义意图在两种语言中都能很好地工作。
当我将 iphone 更新到 iOS 13.4.1 时,我的自定义意图开始出现以下问题(根据安装/测试/设备,我看到了两个问题):
param?”的自定义对话框一样。(或多或少)我觉得这个问题很奇怪也很烦人。我尝试为Intent.intentdefinition: Intent.strings (Base)、重新创建翻译文件Intent.strings (English),Intent.strings (Spanish)我什至尝试重新创建整个自定义意图定义,但我仍然遇到问题。
我还尝试更改手机上的 iOS 语言和 Siri 语言、重新启动、重新安装应用程序、意图等...
这是我的 Sirikit 扩展的 Info.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>InventorySearchIntent</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>IntentsRestrictedWhileLocked</key>
<array/>
<key>IntentsRestrictedWhileProtectedDataUnavailable</key>
<array/>
<key>IntentsSupported</key>
<array>
<string>NumTotalItemsIntent</string>
<string>SearchItemIntent</string>
</array>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.intents-service</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).IntentHandler</string>
</dict>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)
有什么解决办法吗?这是来自 iOS 13.4 的错误吗?Siri 集成对于我正在开发的应用程序非常重要,这对我来说是一个障碍。
提前致谢!
根据我自己的经验,这个问题在 iOS 13.5 beta 4 中得到了修复。我刚刚在 iPhone 6s Plus 上使用 Xcode 11.5 beta 2 (11N605f) 进行了测试。
然而,仍然存在其他问题。例如,在快捷方式中,我的测试项目中的所有操作字符串均以英语显示,而不是本地化语言。
此外,INStringResolutionResult.confirmationRequired(with:)无法按预期工作。
我有一个函数获取用户所说的话并在数据库中查找它们,然后使用 INStringResolutionResult.confirmationRequired(with:) 与用户进行检查。SiriKit目前只使用用户说的话,而不是我与用户核对的结果,这导致最终的代码崩溃。
我刚刚收到苹果错误报告团队的回复。这是我现在得出的结论。