0

I have an app called "French Translator +" in the app store.

There is not enough space below the app icon to display the entire name so I set CFBundleDisplayName = "Translator +".

However, when I type "French" in iOS Search, my app doesn't appear in the results of the section for APPLICATIONS.

How can I get iOS Search to index "French Translator +" while displaying "Translator +" below the app icon?

enter image description here

Marc Bolh
  • 383
  • 3
  • 16
  • See the answer to this question https://stackoverflow.com/questions/32799748/specify-spotlight-keywords-ios-9 – Rudedog Apr 05 '19 at 17:31
  • The Core Spotlight Framework indexes data inside the app, such as an entry for "voiture" in a French dictionary. It doesn't appear to allow adding terms to the search index for the app title, as described above. – Marc Bolh Apr 08 '19 at 12:56
  • I see that you actually asked this question a couple of months ago at https://stackoverflow.com/questions/48343980/how-can-i-choose-a-different-ios-app-name-for-spotlight, *and* the person who answered that time gave you almost exactly the same answer that I gave you today. Is there something wrong with these answers? – Rudedog Apr 08 '19 at 23:30
  • Possible duplicate of [How can I choose a different iOS app name for Spotlight?](https://stackoverflow.com/questions/48343980/how-can-i-choose-a-different-ios-app-name-for-spotlight) – Rudedog Apr 08 '19 at 23:31

1 Answers1

0

The question is already answered in Specify Spotlight keywords iOS 9

As you point out, Core Spotlight indexes data in the app. Data that you provide. So all you need to do is provide it with some data so Spotlight Search can find your app.

Adding this to application(_:didFinishLaunchingWithOptions:) worked for me:

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))")
}
Rudedog
  • 4,323
  • 1
  • 23
  • 34