CoreSpotlight framework vs Spotlight Index Extension?
Asked Answered
D

1

7

CoreSpotlight example:

https://applidium.com/en/news/ios9_search_api/

Spotlight Index Extension example:

http://apprize.info/apple/ios_9/53.html

Could you explain the difference between these 2 ways of Spotlight usage?

Decisive answered 1/8, 2016 at 13:18 Comment(1)
got any answer for your question outside stack? if yes can you please share it here?Eraser
C
8

The CoreSpotlight API lets you reindex your app's content through CSSearchableIndex and CSSearchableItem objects while your app is in foreground. Those (re)indexed objects will then be available on the Spotlight search (a on-device search from the iOS dashboard).

The Spotlight Index Extension lets you do the same but while your app is in the background/killed. The implemented functions of the delegate are only called under certain conditions. This is important in case a problem occurs with your (re)indexed objects.

More detail here:

Spotlight extension points:

  • Use the app indexing extension point to index data in your app.
  • Use the Index Maintenance extension point to support the reindexing of app data without launching the app.

Best

Chatter answered 6/5, 2017 at 2:35 Comment(3)
I've already implemented features with core spotlight framework. It works in background even when app killed too. The only difference I see is the info you highlighted with yellow. But it is still unclear for me so framework may have the same features too. Could you explain it in more details?Decisive
Well it does not seem to me that the CoreSpotlight wakes up the app to (re-index your content. The Spotlight Index App Extension does this and not some code somewhere in your view controllers.Chatter
Ok. Now I understand. But you should at least replace "index" with "reindex" in the answer because it confuses a lot. I though you mean for framework if the app is killed then we can't access stored (indexed) items. So I could accept it as an answer.Decisive

© 2022 - 2024 — McMap. All rights reserved.