Example Implementations
The way you implement search varies depending on the usage model and user experience of your app.
At a high level, your implementation decisions rest on a few primary questions:
Do you have a website that hosts some or all of the content that’s in your app?
Does your app contain user-generated or user-specific data?
Does your app contain content that users are likely to want to revisit?
Keep the answers to these questions in mind as you review the following examples.
Social Networking
Users of social networking apps intend to share data with others, but they also expect to keep some data private. A social networking app can enhance the user experience by making public profile and other public data universally searchable, while also making it easier for individual users to search the on-device index for their private messages and personal data. Table 2-1 lists some examples of how a social networking app can use search APIs.
API |
Example usage |
---|---|
|
Use
Use |
Core Spotlight |
Use Core Spotlight APIs to add details about the user’s first-degree connections and private messages to the on-device index. To learn more, see Core Spotlight Framework Reference. |
Web markup |
On your website, add deep links and metadata to public profiles, pages, and groups to enrich the information about these items in search results. Use universal links to let users open your app when they tap a link to your website. |
News
A news app typically helps users access a lot of information over a broad range of topics while also helping users drill down to get details. Most of the information that a news app handles is public, but users expect their interaction with news data to stay private. Table 2-2 lists some examples of how a news app can use search APIs.
API |
Example usage |
---|---|
|
Use
You can also index articles the user has viewed and use the |
Core Spotlight |
Use Core Spotlight APIs to:
To learn more, see Core Spotlight Framework Reference. |
Web markup |
On your website, add deep links and metadata to articles so that search results can display useful information, such as images. Use universal links to let users open your app when they tap a link to your website. |
Ticket Sales
A ticket sales app needs to make it easy for all users to find information about future events and buy tickets while also helping individual users keep track of their receipts and upcoming events. Table 2-3 lists some examples of how a ticket sales app can use search APIs.
API |
Example usage |
---|---|
|
Use |
Core Spotlight |
Use Core Spotlight APIs to:
To learn more, see Core Spotlight Framework Reference. |
Web markup |
On your website, add deep links and use structured data markup to provide information such as images and prices associated with an event. Use universal links to let users open your app when they tap a link to your website. |
Travel
In terms of search functionality, a travel app is similar to a ticket sales app, because it helps users plan for future events and buy related items. In addition, users typically expect a travel app to provide information about locations, events, and transportation options while also helping them access their private booking or receipt information. Table 2-4 lists some examples of how a travel app can use search APIs.
API |
Example usage |
---|---|
|
Use |
Core Spotlight |
Use Core Spotlight APIs to index:
To learn more, see Core Spotlight Framework Reference. |
Web markup |
On your website, add deep links and use structured data markup to provide information such as ratings, prices, special offers, and addresses associated with locations and attractions. Use universal links to let users open your app when they tap a link to your website. |
Copyright © 2018 Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: 2016-12-15