My app shows nearby restuarants based on users current location. On launch of the app, I'm getting the restaurants based on current location and indexing them using the CoreSpotlight APIs. This works well.
Since the user location keeps changing, I need to update the restaurants. I have following questions.
Does the Search extension helps us to update the restaurants in the background based on current location?
The IndexRequestHandler which is a subclass of CSIndexExtensionRequestHandler implements the CSSearchableIndexDelegate methods. How do we access this class in the containing app? I wanted to set this class as my CSSearchableIndex indexDelegate.
- Should I need to observe for location updates in my app? This way my app will be launched if not running in the background and I can update the restaurants based on my current location using the CoreSpotlight APIs.
- When do we go for Search extension?
- As per my understanding, the container app will download the data and indexes it using the batch APIs. If the App quits in between, then the delegate methods are called. In the delegate method, use the fetchLastClientStateWithCompletionHandler method to identify the client state and resume it. Is it a good place to make network calls?