gpt4 book ai didi

ios - iOS 搜索的应用程序名称可以与 CFBundleDisplayName 不同吗?

转载 作者:行者123 更新时间:2023-11-29 05:52:33 25 4
gpt4 key购买 nike

我在应用商店中有一个名为“法语翻译+”的应用。

应用程序图标下方没有足够的空间来显示整个名称,因此我设置 CFBundleDisplayName = "Translator +"。

但是,当我在 iOS 搜索中输入“法语”时,我的应用程序不会出现在“应用程序”部分的结果中。

如何让 iOS 搜索索引“法语翻译器 +”,同时在应用图标下方显示“翻译器 +”?

enter image description here

最佳答案

问题已在 Specify Spotlight keywords iOS 9 中得到解答

正如您所指出的,Core Spotlight 会索引应用中的数据。 提供的数据。因此,您所需要做的就是向其提供一些数据,以便 Spotlight 搜索可以找到您的应用程序。

将此添加到 application(_:didFinishLaunchingWithOptions:) 对我有用:

let attributeSet = CSSearchableItemAttributeSet(itemContentType: "application")
attributeSet.title = "French Translator"
attributeSet.keywords = ["french", "translation", "translator"]
attributeSet.contentDescription = "French Language Translation App"

let item = CSSearchableItem(uniqueIdentifier: "5C0B7719-3BE7-4441-892D-A786AA431BDD", domainIdentifier: nil, attributeSet: attributeSet)
CSSearchableIndex.default().indexSearchableItems([item]) {
print("Finished indexing with \(String(describing: $0))")
}

关于ios - iOS 搜索的应用程序名称可以与 CFBundleDisplayName 不同吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55537635/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com