This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
This article covers using the App Search APIs provided by iOS 9 to allow users to search for information and features inside your Xamarin.iOS apps.
Search has been expanded in iOS 9 to provide great new ways to access informationand features inside a Xamarin.iOS app. Using the new App Search APIs, app contentis made searchable through Spotlight and Safari search results, Handoff and SiriReminders and Suggestions. This allows users to quickly access activities andinformation deep within your app.
Additionally, the new Search APIs make it easier to integrate search in your appwithout prior search implementation experience. Because of this, Apple claimsthat it typically takes a few hours to make an iOS 9 app's content universallysearchable using App Search.
App Search is composed of three separate APIs:
NSUserActivity - This is an extension of the Handoff API that Applereleased in iOS 8. It is used to make app interaction history searchableboth publicly and privately) by the user.
Core Spotlight - Allows an app to index its content to be presented insearch results. It works like a database API where items can be added andremoved and it is the best way to index private content within an app.
WebMarkup - For apps that provide access to their content via a webinterface (not only from within the app). Web content can be marked up withspecial links that will be crawled by Apple and provide deep linking to yourapp on the user's iOS 9 device.
Deciding which of these methods to implement depends on the types of interactionprovided by your app and the type of content it presents.
Use the following guidelines:
NSUserActivity – Use this framework to provide searchability for bothpublic and private content and also searchability of navigation points within your app.
Core Spotlight – Use this framework to providesearchability for private data stored on the device.
Web Markup – Use this framework to provide searchability for apps that presenttheir content not only from within the app, but from the app's website as well.
Each of the App Search approaches are distinct and can be used individually,however Apple designed them to work together. When using more than one approachto index a specific item, ensure that you use the sameItem ID on each approach,so that individual links work together.
Using more than one approach not only ensures that your content will be found bythe end user but also helps to improve your item's ranking from within search.
While the ranking process in mostly transparent to the developer, user interactionwith a given item weighs heavily upon this rank (for example the user taping a link).By providing rich, informative items, you can ensure that a user will be enticed tointeract with your content, thus raising its ranking.
Apple provides the following suggestions as to what content and actions to providesearch indexes for in your app:
Core Spotlight in iOS 10 provides several enhancements to App Search such as:
CSSearchQuery class to provide in-app Spotlight search ability similar to how the Mail, Messages and Notes apps work.To find out more, please see ourApp Search Enhancements guide.
iOS 10 presents new ways of driving engagement to an app by allowing the system to proactively present helpful information automatically to the user at appropriate times. Just as iOS 9 provided the ability to add deep search to the app using Spotlight, Handoff and Siri Suggestions, with iOS 10 an app can expose functionality that can be presented to the user by the system from within the following locations:
An app exposes this functionality to the system using a collection of technologies such asNSUserActivity, web markup, Core Spotlight, MapKit, Media Player and UIKit.
To find out more, please see ourProactive Suggestions guide.
This article has covered the new Search API features that iOS 9 provides forXamarin.iOS apps. It coveredNSUserActivity,Core SpotlightandWeb Markup methods for indexing content. It finished with a short discussionof when a given search approach should be used and what types of content should be indexed.