introducing search apis - apple inc.€¦ · indexing web content enabling app search 1. allow...

237
© 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. #WWDC15 Introducing Search APIs Increase app usage and discoverability Vipul Ved Prakash Siri Dave Salim Siri Jason Douglas Siri System Frameworks Session 709

Upload: others

Post on 26-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

© 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

#WWDC15

Introducing Search APIsIncrease app usage and discoverability

Vipul Ved Prakash SiriDave Salim SiriJason Douglas Siri

System Frameworks

Session 709

Page 2: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Introducing Search APIs

Page 3: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Introducing Search APIs

86%

14%

Web Apps

Flurry Insights

Time Spent in Apps vs Web

Page 4: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Introducing Search APIs

Developers choose what to index via Search APIs

86%

14%

Web Apps

Flurry Insights

Time Spent in Apps vs Web

Page 5: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Introducing Search APIs

Developers choose what to index via Search APIsApp results appear in Spotlight and Safari

Page 6: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Introducing Search APIs

Developers choose what to index via Search APIsApp results appear in Spotlight and SafariApp results even appear when app not installed

Page 7: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 8: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 9: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 10: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 11: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 12: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 13: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 14: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 15: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 16: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 17: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

App and Content Discovery

Page 18: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

App and Content Discovery

Deep links also in Apple’s cloud index

Cloud Index

Page 19: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

App and Content Discovery

Deep links also in Apple’s cloud indexDevelopers can tag content as public

Cloud Index

Popular PublicItems

Device Index

Device Index

Device Index

Device Index

Device Index

Popular PublicItems

Page 20: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

App and Content Discovery

Deep links also in Apple’s cloud indexDevelopers can tag content as public

Page 21: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

App and Content Discovery

Apple finds deep links from the web

Cloud Index

Applebot

App Website

Device IndexApp

Website

Device IndexApp

Website

Deep links also in Apple’s cloud indexDevelopers can tag content as public

Page 22: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

App and Content Discovery

Apple finds deep links from the webSeamlessly appear in iOS 9 Search

Cloud Index

Applebot

App Website

Device IndexApp

Website

Device IndexApp

Website

Deep links also in Apple’s cloud indexDevelopers can tag content as public

Page 23: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 24: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 25: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 26: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 27: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

App SearchThree APIs

Page 28: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity

Viewed App Content

App SearchThree APIs

Page 29: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

CoreSpotlightNSUserActivity

Viewed App Content Any App Content

App SearchThree APIs

Page 30: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

CoreSpotlightNSUserActivity Web Markup

Viewed App Content Any App Content App Content on Web

App SearchThree APIs

Page 31: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity

CoreSpotlight

Web Markup

Achieving Best Results

User Guidelines

1

2

3

4

5

Page 32: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity & CoreSpotlight

Dave Salim

Page 33: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivityIndexes viewed app content

CoreSpotlightNSUserActivity Web Markup

Viewed App Content Any App Content App Content on Web

Page 34: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivityIndexes viewed app content

CoreSpotlightNSUserActivity Web Markup

Viewed App Content Any App Content App Content on Web

Page 35: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivityBackground

Page 36: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivityBackground

Introduced in iOS 8 Used in Handoff Create activities in specific parts of your appHandle continuing incoming activities in your app

Page 37: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity and App Search

Page 38: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity and App Search

Activities can be designated as searchable Add indexable metadataResults in iOS Search and SafariRevisit activity on search selection

Page 39: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivityApp search

Page 40: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivityApp search

Page 41: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivityApp search

NSUserActivity

Page 42: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivityApp search

NSUserActivity Metadata

Page 43: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivityApp search

On-Device Index

Item 1

NSUserActivity Metadata

Page 44: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivityApp search

On-Device Index

Item 1

Page 45: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivityApp search

On-Device Index

Item 1

NSUserActivity

Page 46: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivityApp search

On-Device Index

Item 1

NSUserActivity Metadata

Page 47: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivityApp search

On-Device Index

Item 1

NSUserActivity Metadata

Item 2

Page 48: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity API

Page 49: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity API

Enable Capabilitiesvar eligibleForHandoff: Bool var eligibleForSearch: Bool var eligibleForPublicIndexing: Bool

Page 50: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity API

Enable Capabilitiesvar eligibleForHandoff: Bool var eligibleForSearch: Bool var eligibleForPublicIndexing: Bool

Provide Attributes and Keywordsvar title: String? var keywords: Set<String> var contentAttributeSet: CSSearchableItemAttributeSet? var expirationDate: NSDate

Page 51: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity API

Enable Capabilitiesvar eligibleForHandoff: Bool var eligibleForSearch: Bool var eligibleForPublicIndexing: Bool

Provide Attributes and Keywordsvar title: String? var keywords: Set<String> var contentAttributeSet: CSSearchableItemAttributeSet? var expirationDate: NSDate

Restoring on the Webvar webpageURL: NSURL?

Page 52: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Create Activity

Page 53: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Create Activity

var activity:NSUserActivity = NSUserActivity(activityType: "com.yummly.browseRecipe")

Page 54: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Create Activity

var activity:NSUserActivity = NSUserActivity(activityType: "com.yummly.browseRecipe")

activity.title = "Baked Potato Chips"activity.userInfo = ["id": “http://www.yummly.com/recipe/BPC-983195”]

Page 55: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Create Activity

var activity:NSUserActivity = NSUserActivity(activityType: "com.yummly.browseRecipe")

activity.title = "Baked Potato Chips"activity.userInfo = ["id": “http://www.yummly.com/recipe/BPC-983195”]

activity.eligibleForSearch = true

Page 56: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Create Activity

var activity:NSUserActivity = NSUserActivity(activityType: "com.yummly.browseRecipe")

activity.title = "Baked Potato Chips"activity.userInfo = ["id": “http://www.yummly.com/recipe/BPC-983195”]

activity.eligibleForSearch = true

activity.becomeCurrent()

Page 57: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 58: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

activity.title

Page 59: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

activity.title

contentAttributeSet.contentDescription

Page 60: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

activity.title

contentAttributeSet.contentDescription

contentAttributeSet.thumbnailData

Page 61: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Continue ActivityUIApplicationDelegate

func application(UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: [AnyObject]? -> Void) -> Bool {

return true }

Page 62: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Continue ActivityUIApplicationDelegate

func application(UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: [AnyObject]? -> Void) -> Bool {

return true }

Page 63: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Continue ActivityUIApplicationDelegate

func application(UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: [AnyObject]? -> Void) -> Bool {

return true }

if userActivity.activityType == “com.yummly.browseRecipe” {

// Restore state for userActivity and userInfo

}

Page 64: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 65: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 66: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity and Public Indexing

Page 67: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity and Public Indexing

Activities can be designated as public Multiple users engage with device resultsPopular public results available to other users Results in Search and Safari (if URL included)

Page 68: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

User 1

NSUserActivity and Public Indexing

Page 69: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

User 1

Public Activity

NSUserActivity and Public Indexing

Page 70: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

User 1

Public Activity

NSUserActivity and Public Indexing

Cloud Index

Public Activity

Page 71: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

User 1

Public Activity

NSUserActivity and Public Indexing

Cloud Index

Public Activity

User 2

Page 72: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

User 1

Public Activity

NSUserActivity and Public Indexing

Cloud Index

Public Activity

User 2 User 3

Page 73: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Designating Activities Public

var activity:NSUserActivity = NSUserActivity(activityType: “com.yummly.browseRecipe“)

activity.title = “Baked Potato Chips"

activity.userInfo = ["id": "http://www.yummly.com/recipe/BPC-983195"]

activity.eligibleForSearch = true

activity.becomeCurrent()

Page 74: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Designating Activities Public

var activity:NSUserActivity = NSUserActivity(activityType: “com.yummly.browseRecipe“)

activity.title = “Baked Potato Chips"

activity.userInfo = ["id": "http://www.yummly.com/recipe/BPC-983195"]

activity.eligibleForSearch = true

activity.eligibleForPublicIndexing = true

activity.becomeCurrent()

Page 75: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity and Public IndexingPrivacy

Page 76: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity and Public IndexingPrivacy

Activities are private by defaultDesignate “public” if searchable activity fields are solely publicProvisions to prevent user-specific activities from being indexed

Page 77: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity and Public IndexingPrivacy

Activities are private by defaultDesignate “public” if searchable activity fields are solely publicProvisions to prevent user-specific activities from being indexed

Cloud Index

Device 1

Hash

threshold exceed?false

Page 78: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

NSUserActivity and Public IndexingPrivacy

Activities are private by defaultDesignate “public” if searchable activity fields are solely publicProvisions to prevent user-specific activities from being indexed

Cloud Index

Device nDevice 1

Popular PublicItem

Device 2 Device 3 Device 4 …

Hash

threshold exceed?true

HashHash

Hash Hash

Page 79: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Additional Benefits

Page 80: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Additional Benefits

Page 81: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Additional BenefitsHandoff

Mac Screenshot of Safari

Page 82: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Additional BenefitsHandoff

Mac Screenshot of Safari

Page 83: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Additional BenefitsHandoff

Mac Screenshot of Safari

Page 84: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Additional BenefitsHandoff

Mac Screenshot of Safari

Page 85: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Additional BenefitsHandoff

Mac Screenshot of Safari

Page 86: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Additional BenefitsHandoff

Mac Screenshot of Safari

Page 87: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Additional BenefitsSiri suggestions and smart reminders

Page 88: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 89: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 90: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 91: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 92: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

CoreSpotlightIndexes any app content

CoreSpotlightNSUserActivity Web Markup

Viewed App Content Any App Content App Content on Web

Page 93: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

CoreSpotlightIndexes any app content

CoreSpotlightNSUserActivity Web Markup

Viewed App Content Any App Content App Content on Web

Page 94: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

CoreSpotlightOverview

Page 95: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

CoreSpotlightOverview

New Framework in iOS 9For any app contentMethods to add, update, and delete items Used by Messages, Mail, Calendar, and Notes

Page 96: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

CoreSpotlight API

Page 97: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

CoreSpotlight API

CSSearchableItem

Page 98: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

CoreSpotlight API

CSSearchableItem CSSearchableItemAttributeSet(Metadata)

Page 99: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

CoreSpotlight API

CSSearchableIndex

CSSearchableItem CSSearchableItemAttributeSet(Metadata)

Page 100: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

CoreSpotlight API

CSSearchableIndex

Item 1Item 2

Item 3Item 4

Item 5

CSSearchableItem CSSearchableItemAttributeSet(Metadata)

Item 6

Page 101: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Create Item

Page 102: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Create Item

// Create attributeSet and populate with metadata let attributeSet = CSSearchableItemAttributeSet(itemContentType: kUTTypeImage as String)

Page 103: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Create Item

// Create attributeSet and populate with metadata let attributeSet = CSSearchableItemAttributeSet(itemContentType: kUTTypeImage as String)

attributeSet.title = "Haleakala Sunrise"attributeSet.contentDescription = “May 12, 2015 Maui, Hawaii”

Page 104: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Create Item

// Create attributeSet and populate with metadata let attributeSet = CSSearchableItemAttributeSet(itemContentType: kUTTypeImage as String)

attributeSet.title = "Haleakala Sunrise"attributeSet.contentDescription = “May 12, 2015 Maui, Hawaii”

// Create item with unique identifier; domainIdentifier used to group itemslet item = CSSearchableItem(uniqueIdentifier: "1", domainIdentifier: "album-1", attributeSet: attributeSet)

Page 105: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Create Item

// Create attributeSet and populate with metadata let attributeSet = CSSearchableItemAttributeSet(itemContentType: kUTTypeImage as String)

attributeSet.title = "Haleakala Sunrise"attributeSet.contentDescription = “May 12, 2015 Maui, Hawaii”

// Create item with unique identifier; domainIdentifier used to group itemslet item = CSSearchableItem(uniqueIdentifier: "1", domainIdentifier: "album-1", attributeSet: attributeSet)

// Index item CSSearchableIndex.defaultSearchableIndex().indexSearchableItems([item]) { error in if error != nil { print(error?.localizedDescription) } else { print("Item indexed!") }}

Page 106: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 107: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

attributeSet.title

Page 108: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

attributeSet.title

attributeSet.contentDescription

Page 109: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

attributeSet.title

attributeSet.contentDescription

attributeSet.thumbnailData

Page 110: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

RestoreOverview

Page 111: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

RestoreOverview

Implement UIApplication delegateSame delegate method used for continuing NSUserActivity

Page 112: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

RestoreOverview

Page 113: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

RestoreOverview

// Application delegate called when CoreSpotlight result is tapped func application(UIApplication, continueUserActivity userActivity: NSUserActivity,

restorationHandler: [AnyObject]? -> Void) -> Bool {

return true }

Page 114: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

RestoreOverview

// Application delegate called when CoreSpotlight result is tapped func application(UIApplication, continueUserActivity userActivity: NSUserActivity,

restorationHandler: [AnyObject]? -> Void) -> Bool {

return true }

if userActivity.activityType == CSSearchableItemActionType {

}

Page 115: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

RestoreOverview

// Application delegate called when CoreSpotlight result is tapped func application(UIApplication, continueUserActivity userActivity: NSUserActivity,

restorationHandler: [AnyObject]? -> Void) -> Bool {

return true }

if userActivity.activityType == CSSearchableItemActionType {

}

let uniqueIdentifier = userActivity.userInfo? [CSSearchableItemActivityIdentifier] as? String

// Use 'uniqueIdentifier'

Page 116: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 117: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 118: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Update

Same method as adding item to indexfunc indexSearchableItems(items: [CSSearchableItem], completionHandler: ((NSError?) -> Void)?)

CSSearchableIndex

Item 1Item 2

Item 3Item 4

Item 5Item 6

Page 119: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Update

Same method as adding item to indexfunc indexSearchableItems(items: [CSSearchableItem], completionHandler: ((NSError?) -> Void)?)

CSSearchableItem

CSSearchableIndex

Item 1Item 2

Item 3Item 4

Item 5Item 6

Page 120: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Update

Same method as adding item to indexfunc indexSearchableItems(items: [CSSearchableItem], completionHandler: ((NSError?) -> Void)?)

CSSearchableItemAttributeSet(Metadata)CSSearchableItem

CSSearchableIndex

Item 1Item 2

Item 3Item 4

Item 5Item 6

Page 121: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Update

Same method as adding item to indexfunc indexSearchableItems(items: [CSSearchableItem], completionHandler: ((NSError?) -> Void)?)

CSSearchableItemAttributeSet(Metadata)CSSearchableItem

CSSearchableIndex

Item 1Item 2

Item 3Item 4

Item 5Item 6

Item 1

Page 122: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

DeleteIdentifiers

func deleteSearchableItemsWithIdentifiers(identifiers: [String], completionHandler: ((NSError?) -> Void)?)

CSSearchableIndex

Item 2Item 3Item 1

Item 4Item 5

Item 6

Page 123: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

DeleteIdentifiers

func deleteSearchableItemsWithIdentifiers(identifiers: [String], completionHandler: ((NSError?) -> Void)?)

CSSearchableIndex

Item 2Item 3Item 1

Item 4Item 5

Item 6

identifiers = [“1”, “4”, “5”]

Page 124: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

DeleteIdentifiers

func deleteSearchableItemsWithIdentifiers(identifiers: [String], completionHandler: ((NSError?) -> Void)?)

CSSearchableIndex

Item 2Item 3

Item 6

identifiers = [“1”, “4”, “5”]

Page 125: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

func deleteSearchableItemsWithDomainIdentifiers(domainIdentifiers: [String], completionHandler: ((NSError?) -> Void)?)

CSSearchableIndex

domain-1

DeleteDomainIdentifier

Item 1Item 2

Item 3

domain-2

Item 4Item 5

Item 6

Page 126: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

func deleteSearchableItemsWithDomainIdentifiers(domainIdentifiers: [String], completionHandler: ((NSError?) -> Void)?)

CSSearchableIndex

domain-1

DeleteDomainIdentifier

Item 1Item 2

Item 3

domain-2

Item 4Item 5

Item 6

domainIdentifiers = [“domain-2”]

Page 127: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

func deleteSearchableItemsWithDomainIdentifiers(domainIdentifiers: [String], completionHandler: ((NSError?) -> Void)?)

CSSearchableIndex

domain-1

DeleteDomainIdentifier

Item 1Item 2

Item 3

domainIdentifiers = [“domain-2”]

Page 128: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

func deleteAllSearchableItemsWithCompletionHandler(completionHandler: ((NSError?) -> Void)?)

CSSearchableIndex

DeleteAll

Item 1Item 2

Item 3Item 4

Item 5Item 6

Page 129: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

func deleteAllSearchableItemsWithCompletionHandler(completionHandler: ((NSError?) -> Void)?)

CSSearchableIndex

DeleteAll

Page 130: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

DemoOverview

Photo viewerIndex photos by titleSearchRestore

Page 131: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Additional FeaturesOverview

BatchingCSSearchableIndexDelegate ExtensionData Protection classes

Page 132: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Web Markup

Jason Douglas

Page 133: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Web MarkupIndexes app content on web

CoreSpotlightNSUserActivity Web Markup

Viewed App Content Any App Content App Content on Web

Page 134: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Web MarkupIndexes app content on web

CoreSpotlightNSUserActivity Web Markup

Viewed App Content Any App Content App Content on Web

Page 135: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Indexing Web Content

The content driving your app may live on the web, not locally inside the appDeep linked pages from your app's website are indexed for app search

Page 136: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Indexing Web Content

Cloud Index

Popular PublicItems

Device Index

Device Index

Device Index

Device Index

Device Index

Page 137: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Indexing Web Content

Cloud Index

Popular PublicItems

Device Index

Device Index

Device Index

Device Index

Device Index

App Website

Device IndexApp

Website

Device IndexApp

WebsiteApplebot

Page 138: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Indexing Web Content

Page 139: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 140: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains
Page 141: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Indexing Web ContentEnabling app search

Page 142: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Indexing Web ContentEnabling app search

1. Allow Apple to discover and index your app’s website

Page 143: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Indexing Web ContentEnabling app search

1. Allow Apple to discover and index your app’s website2. Ensure your app's website contains markup for mobile deep links

Page 144: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Indexing Web ContentEnabling app search

1. Allow Apple to discover and index your app’s website2. Ensure your app's website contains markup for mobile deep links3. Enable deep link handling for your app

Page 145: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Indexing Web ContentEnabling app search

1. Allow Apple to discover and index your app’s website2. Ensure your app's website contains markup for mobile deep links3. Enable deep link handling for your app4. Add markup for structured data (optional, but highly recommended)

Page 146: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

apple.com

App Video Preview and Screenshots ?

4-Inch iPad3.5-Inch 4.7-Inch 5.5-Inch

Localizable Information

Description ?

Make travel planning as mobile as you are with the Airbnb iPhone App! Airbnb opens the door to the world’s most interesting places to stay and is the simplest way to earn money from your extra space. With over 600,000 listings in more than 34,000 cities, Airbnb connects you with the experience that’s right for you.

Message hosts and guests, gush over your itinerary, explore fairytale destinations, and add unforgettable digs to your Wish List. Make that penthouse, yurt, or treehouse your next home...or open up your own space to travelers.

1717

Support URL ?

http://airbnb.com/help

Marketing URL ?

http://airbnb.com/mobile

Keywords ?

airbnb, travel, accommodations, app

English (U.S.)

Choose File Delete All 4/4 Screenshots

Page 147: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

apple.com

App Video Preview and Screenshots ?

4-Inch iPad3.5-Inch 4.7-Inch 5.5-Inch

Localizable Information

Description ?

Make travel planning as mobile as you are with the Airbnb iPhone App! Airbnb opens the door to the world’s most interesting places to stay and is the simplest way to earn money from your extra space. With over 600,000 listings in more than 34,000 cities, Airbnb connects you with the experience that’s right for you.

Message hosts and guests, gush over your itinerary, explore fairytale destinations, and add unforgettable digs to your Wish List. Make that penthouse, yurt, or treehouse your next home...or open up your own space to travelers.

1717

Support URL ?

http://airbnb.com/help

Marketing URL ?

http://airbnb.com/mobile

Keywords ?

airbnb, travel, accommodations, app

English (U.S.)

Choose File Delete All 4/4 Screenshots

Page 148: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your WebsiteSmart App Banners

Smart App Banner provides a clear link into your appIf app is not installed, Safari prompts the user

<meta name="myApp" content="app-id=123, app-argument=http://example.com/about”>

See Promoting Apps with Smart App Banners on the Safari Web Content Guide

Page 149: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your WebsiteSmart App Banners

Smart App Banner provides a clear link into your appIf app is not installed, Safari prompts the user

<meta name="myApp" content="app-id=123, app-argument=http://example.com/about”>

See Promoting Apps with Smart App Banners on the Safari Web Content Guide

Page 150: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your WebsiteUniversal links

Universal links have several advantages over custom URL schemes

Seamless Linking to Your App Nob Hill Thursday 3:30PM

Page 151: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your WebsiteUniversal links

Universal links have several advantages over custom URL schemes• Unique

Seamless Linking to Your App Nob Hill Thursday 3:30PM

Page 152: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your WebsiteUniversal links

Universal links have several advantages over custom URL schemes• Unique• Secure

Seamless Linking to Your App Nob Hill Thursday 3:30PM

Page 153: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your WebsiteUniversal links

Universal links have several advantages over custom URL schemes• Unique• Secure• Flexible

Seamless Linking to Your App Nob Hill Thursday 3:30PM

Page 154: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your WebsiteUniversal links

Universal links have several advantages over custom URL schemes• Unique• Secure• Flexible• Work seamlessly across app and website

Seamless Linking to Your App Nob Hill Thursday 3:30PM

Page 155: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your WebsiteUniversal links

Deep links still need to be exposed via website’s markupUse either Smart App Banners or an alternative supported standard

Seamless Linking to Your App Nob Hill Thursday 3:30PM

Page 156: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your WebsiteOther deep link schemes

Page 157: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your WebsiteOther deep link schemes

Other standards are supported as well, such as Twitter Cards:<meta name="twitter:app:name:iphone" content="myAppName"> <meta name="twitter:app:id:iphone" content="myAppID"> <meta name="twitter:app:url:iphone" content="myURL">

Page 158: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your WebsiteOther deep link schemes

Other standards are supported as well, such as Twitter Cards:<meta name="twitter:app:name:iphone" content="myAppName"> <meta name="twitter:app:id:iphone" content="myAppID"> <meta name="twitter:app:url:iphone" content="myURL">

And Facebook’s App Links:<meta property="al:ios:app_name" content="myAppName"> <meta property="al:ios:app_store_id" content="myAppID"> <meta property="al:ios:url" content="myURL">

Page 159: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your AppSupport deep linking

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {

// In this example, the URL is http://example.com/profile/?123 if url.path == "/profile" {

// Pass the profile ID from the URL, to the view controller profileViewController.loadProfile(url.query); }

return false }

Page 160: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your AppSupport deep linking

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {

// In this example, the URL is http://example.com/profile/?123 if url.path == "/profile" {

// Pass the profile ID from the URL, to the view controller profileViewController.loadProfile(url.query); }

return false }

Page 161: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your AppSupport deep linking

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {

// In this example, the URL is http://example.com/profile/?123 if let components = NSURLComponents(URL: url, resolvingAgainstBaseURL: true), let path = components.path, let query = components.query {

} return false }

Page 162: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Preparing Your AppSupport deep linking

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {

// In this example, the URL is http://example.com/profile/?123 if let components = NSURLComponents(URL: url, resolvingAgainstBaseURL: true), let path = components.path, let query = components.query { if path == "/profile" { // Pass the profile ID from the URL, to the view controller return profileViewController.loadProfile(query)

} } return false }

Page 163: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSemantic markup calls out key information

Go beyond just a title and descriptionResults can contain images, structured data, and even actionsRich results are more engaging to users and can improve your ranking

Page 164: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSemantic markup calls out key information

Open Graph:<meta property="og:image" content="http://example.com/hello.jpg"> <meta property="og:audio" content="http://example.com/music.m4a"> <meta property="og:video" content="http://example.com/cats.mp4">

Page 165: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSemantic markup calls out key information

schema.org Microdata:<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> <span itemprop="ratingValue">4</span> stars - <span itemprop="reviewCount">250</span> reviews </div>

Page 166: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSemantic markup calls out key information

schema.org JSON-LD:<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "AggregateRating", "ratingValue": "4", "reviewCount": "250" } </script>

Page 167: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSemantic markup calls out key information

Page 168: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSemantic markup calls out key information

Page 169: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSemantic markup calls out key information

<title>Napa Valley Dream House in Napa</title>

Page 170: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSemantic markup calls out key information

<meta itemprop="priceCurrency" content="USD"> <meta itemprop="price" content="650">

<title>Napa Valley Dream House in Napa</title>

Page 171: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSemantic markup calls out key information

<meta itemprop="priceCurrency" content="USD"> <meta itemprop="price" content="650">

<span itemprop="reviewCount">29</span>

<title>Napa Valley Dream House in Napa</title>

Page 172: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSemantic markup calls out key information

<meta itemProp="ratingValue" content="5.0">

<meta itemprop="priceCurrency" content="USD"> <meta itemprop="price" content="650">

<span itemprop="reviewCount">29</span>

<title>Napa Valley Dream House in Napa</title>

Page 173: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSemantic markup calls out key information

<meta property="og:image" content="http://...">

<meta itemProp="ratingValue" content="5.0">

<meta itemprop="priceCurrency" content="USD"> <meta itemprop="price" content="650">

<span itemprop="reviewCount">29</span>

<title>Napa Valley Dream House in Napa</title>

Page 174: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSupported schemas

Page 175: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSupported schemas

AggregateRating

Page 176: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSupported schemas

AggregateRatingOffers

Page 177: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSupported schemas

AggregateRatingOffersPriceRange

Page 178: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSupported schemas

AggregateRatingOffersPriceRangeInteractionCount

Page 179: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSupported schemas

AggregateRatingOffersPriceRangeInteractionCountOrganization

Page 180: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSupported schemas

AggregateRatingOffersPriceRangeInteractionCountOrganizationRecipe

Page 181: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSupported schemas

AggregateRatingOffersPriceRangeInteractionCountOrganizationRecipeSearchAction

Page 182: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsSupported schemas

AggregateRatingOffersPriceRangeInteractionCountOrganizationRecipeSearchActionImageObject

Page 183: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsActions

Certain structured data allows your results to be actionable

Page 184: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsActions

Certain structured data allows your results to be actionableCurrent supported actions are:• Dialing a phone number

Page 185: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsActions

Certain structured data allows your results to be actionableCurrent supported actions are:• Dialing a phone number• Getting directions to an address

Page 186: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsActions

Certain structured data allows your results to be actionableCurrent supported actions are:• Dialing a phone number• Getting directions to an address• Playing audio or video

Page 187: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsActions

Page 188: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsActions

<div itemscope itemtype= "http://schema.org/Organization"> <span itemprop="telephone"> (408) 123-4567</span> </div>

Page 189: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsActions

<div itemscope itemtype= "http://schema.org/Organization"> <span itemprop="telephone"> (408) 123-4567</span> </div>

<div itemscope itemtype= "http://schema.org/AudioObject"> <meta itemprop="contentUrl" content="http://abc.com/x.m4a" /> </div>

Page 190: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsActions

Page 191: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsActions

<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> <span itemprop="streetAddress"> 200 Innovation Way </span> <span itemprop="addressLocality"> San Francisco</span> <span itemprop="addressRegion"> CA</span> <span itemprop="postalCode"> 94108</span> </div>

Page 192: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsTesting tools

App search markup validator for deep link and structured data testingCheck our developer site for more information later this year:http://developer.apple.com/ios/search/

Page 193: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Rich ResultsResources

App Search Developer Site http://developer.apple.com/ios/search/

Twitter’s Cards Protocolhttp://dev.twitter.com/cards/mobile

Facebook’s App Linkshttp://applinks.org

schema.orghttp://schema.org

Open Graphhttp://ogp.me

Page 194: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Achieving Best Results

Page 195: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Adopting Multiple APIs

CoreSpotlightNSUserActivity Web Markup

Viewed App Content Any App Content App Content on Web

Page 196: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance: Linking APIs

CoreSpotlightNSUserActivity Web Markup

Viewed App Content Any App Content App Content on Web

Page 197: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance: Linking APIs

CoreSpotlight

NSUserActivity Web Markup

Page 198: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance: Linking APIs

CoreSpotlight

NSUserActivity Web Markup

Page 199: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance: Linking APIs

CoreSpotlight

NSUserActivity Web Markup

URL URL

URL

Page 200: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance: Linking APIs

CoreSpotlight

NSUserActivity Web Markup

URL URL

URL

NSUserActivity .contentAttributeSet .relatedUniqueIdentifier

NSUserActivity.webpageURL

CSSearchableItem.UniqueIdentifier

Web page URL

Page 201: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance: Linking APIs

CoreSpotlightNSUserActivity

Page 202: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance: Linking APIs

CoreSpotlightNSUserActivity

ID ID

NSUserActivity .contentAttributeSet .relatedUniqueIdentifier

CSSearchableItem .UniqueIdentifier

Page 203: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance Understanding the basis of relevance

Page 204: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance Understanding the basis of relevance

Goal to provide most relevant results

Page 205: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance Understanding the basis of relevance

Goal to provide most relevant resultsResult quality a function of user interaction

Page 206: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance Understanding the basis of relevance

Goal to provide most relevant resultsResult quality a function of user interaction

URL Popularity

Activities (NSUserActivity)

Engagements

Page 207: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance Understanding the basis of relevance

Goal to provide most relevant resultsResult quality a function of user interaction

Relevance Score

URL Popularity

Activities (NSUserActivity)

Engagements

Page 208: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance Understanding the basis of relevance

Goal to provide most relevant resultsResult quality a function of user interaction

Relevance Score

URL Popularity

Activities (NSUserActivity)

Engagements

Page 209: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Relevance Understanding the basis of relevance

Goal to provide most relevant resultsResult quality a function of user interaction

Relevance Score

URL Popularity

Activities (NSUserActivity)

Engagements

Page 210: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Optimizing RelevanceBest practices

Page 211: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Optimizing RelevanceBest practices

Create great apps and contentAdopt API provisions that contribute to relevance• NSUserActivity• NSUSerActivity public indexing where appropriate• Schema markup for ratings and reviews

Follow User Interface Guidelines

Page 212: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Protecting RelevanceRanking works in both directions

Page 213: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Protecting RelevanceRanking works in both directions

Search will down-rank or suppress poor resultsMalicious or poorly considered implementations penalizedRatio of engagement-to-shown a key quality metric

Page 214: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

User Experience Guidelines

Page 215: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Descriptive Results

Page 216: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Descriptive Results

Richer results have better satisfaction and engagement• Thumbnail, well-structured description, ratings, and actions• Relevant and appealing image• Key information user is looking for

Page 217: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Descriptive Results

Richer results have better satisfaction and engagement• Thumbnail, well-structured description, ratings, and actions• Relevant and appealing image• Key information user is looking for

Keywords associate your result with queries • Typical items should have 3 to 5 keywords• Category keywords, e.g., “ticket” or “recipe” • Synonyms or abbreviations for item subject

Page 218: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

UI Behavior on App LaunchGet users to content with minimal distraction

Page 219: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

UI Behavior on App LaunchGet users to content with minimal distraction

Go straight to content, no interstitials or multi-step buildsGuidelines apply to both app and web linksTime from result to content is measured and used in ranking

Page 220: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

UI Behavior on App LaunchExamples

Page 221: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

UI Behavior on App LaunchExamples

Page 222: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

What to Index

Page 223: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

What to Index

Any content viewed, created, or curated by user

Page 224: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

What to Index

Any content viewed, created, or curated by user Navigation points and features

Page 225: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

What to Index

Any content viewed, created, or curated by user Navigation points and featuresNew messages, content, or items arriving on device

Page 226: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

What to Index

Any content viewed, created, or curated by user Navigation points and featuresNew messages, content, or items arriving on device Consider proactively indexed items of potential interest

Page 227: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

What to Index

Any content viewed, created, or curated by user Navigation points and featuresNew messages, content, or items arriving on device Consider proactively indexed items of potential interest iOS Search is flexible, extensible, and open to creativity

Page 228: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Summary

Page 229: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Summary

Page 230: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Summary

Fast on-device and cloud search

Page 231: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Summary

Fast on-device and cloud search Three easy-to-adopt APIs

Page 232: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Summary

Fast on-device and cloud search Three easy-to-adopt APIs Increase engagement

Page 233: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Summary

Fast on-device and cloud search Three easy-to-adopt APIs Increase engagement Free organic marketing

Page 234: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

More Information

Technical SupportApple Developer Forumshttp://developer.apple.com/forums

DocumentationSearch APIs Documentationhttp://developer.apple.com/ios/search

General InquiriesPaul Marcos, Software [email protected]

Page 235: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Related Sessions

Seamless Linking to Your App Nob Hill Thursday 3:30PM

Page 236: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains

Labs

App Search and Spotlight Lab Frameworks Lab A Wednesday 12:00PM

App Search and Spotlight Lab Frameworks Lab E Friday 1:30PM

Page 237: Introducing Search APIs - Apple Inc.€¦ · Indexing Web Content Enabling app search 1. Allow Apple to discover and index your app’s website 2. Ensure your app's website contains