SearchInAppsSDK Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
ContextualSearchRuntime
@objc
final class ContextualSearchRuntime
Runtime for issuing contextual search requests.
The runtime can be reused across the app after it is initialized.
-
Parameters
withOptions
|
The input options used to generate search content.
|
-
Parameters
withOptions
|
The input options used to generate search suggestions.
|
-
Parameters
withOptions
|
The input options used to generate trending searches.
|
-
Creates a new Search Runtime.
The Search Runtime can be created at app startup and only needs to be
created once. It can be reused throuhgout the app’s lifecycle.
Declaration
Swift
override dynamic convenience init()
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eContextualSearchRuntime\u003c/code\u003e class is used for issuing contextual search requests within an app and can be reused throughout its lifecycle.\u003c/p\u003e\n"],["\u003cp\u003eThis class provides methods for retrieving search content, suggestions, and trending searches based on specified options.\u003c/p\u003e\n"],["\u003cp\u003eEach method, such as \u003ccode\u003egetSearchContent\u003c/code\u003e, \u003ccode\u003egetSearchSuggestions\u003c/code\u003e, and \u003ccode\u003egetTrendingSearches\u003c/code\u003e, accepts input options to tailor the search results.\u003c/p\u003e\n"],["\u003cp\u003eA new \u003ccode\u003eContextualSearchRuntime\u003c/code\u003e instance can be created using its initializer \u003ccode\u003einit()\u003c/code\u003e, preferably at app startup for optimal performance.\u003c/p\u003e\n"]]],["The `ContextualSearchRuntime` class, reusable across an app, provides methods for contextual search requests. It allows fetching search content via `getSearchContent(withOptions:)`, requiring input options. It also retrieves search suggestions with `getSearchSuggestions(withOptions:)`, using provided options. Furthermore, `getTrendingSearches(withOptions:)` fetches trending searches, also based on given options. Finally it has an init method that can be used to instantiate the object. These functions, available on iOS 14+, operate asynchronously.\n"],null,["# SearchInAppsSDK Framework Reference\n\nContextualSearchRuntime\n=======================\n\n @objc\n final class ContextualSearchRuntime\n\nRuntime for issuing contextual search requests.\n\nThe runtime can be reused across the app after it is initialized.\n- `\n ``\n ``\n `\n\n ### [getSearchContent(withOptions:)](#/c:@M@SearchInAppsSDK@objc(cs)ContextualSearchRuntime(im)getSearchContentWithOptions:completionHandler:)\n\n `\n ` \n Gets search content. \n\n #### Declaration\n\n Swift \n\n @available(iOS, introduced: 14)\n @objc\n final func getSearchContent(withOptions options: ../Classes/GetSearchContentOptions.html) async throws -\u003e ../Classes/SearchContents.html\n\n #### Parameters\n\n |---------------------|----------------------------------------------------|\n | ` `*withOptions*` ` | The input options used to generate search content. |\n\n- `\n ``\n ``\n `\n\n ### [getSearchSuggestions(withOptions:)](#/c:@M@SearchInAppsSDK@objc(cs)ContextualSearchRuntime(im)getSearchSuggestionsWithOptions:completionHandler:)\n\n `\n ` \n Gets search suggestions. \n\n #### Declaration\n\n Swift \n\n @available(iOS, introduced: 14)\n @objc\n final func getSearchSuggestions(withOptions getSearchSuggestionsOptions: ../Classes/GetSearchSuggestionsOptions.html) async throws -\u003e ../Classes.html#/c:@M@SearchInAppsSDK@objc(cs)SearchSuggestions\n\n #### Parameters\n\n |---------------------|--------------------------------------------------------|\n | ` `*withOptions*` ` | The input options used to generate search suggestions. |\n\n- `\n ``\n ``\n `\n\n ### [getTrendingSearches(withOptions:)](#/c:@M@SearchInAppsSDK@objc(cs)ContextualSearchRuntime(im)getTrendingSearchesWithOptions:completionHandler:)\n\n `\n ` \n Gets trending searches. \n\n #### Declaration\n\n Swift \n\n @available(iOS, introduced: 14)\n @objc\n final func getTrendingSearches(withOptions getTrendingSearchesOptions: ../Classes/GetTrendingSearchesOptions.html? = ../Classes/GetTrendingSearchesOptions.html()) async throws -\u003e ../Classes.html#/c:@M@SearchInAppsSDK@objc(cs)SearchSuggestions\n\n #### Parameters\n\n |---------------------|-------------------------------------------------------|\n | ` `*withOptions*` ` | The input options used to generate trending searches. |\n\n- `\n ``\n ``\n `\n\n ### [init()](#/c:@M@SearchInAppsSDK@objc(cs)ContextualSearchRuntime(im)init)\n\n `\n ` \n Creates a new Search Runtime.\n\n The Search Runtime can be created at app startup and only needs to be\n created once. It can be reused throuhgout the app's lifecycle. \n\n #### Declaration\n\n Swift \n\n override dynamic convenience init()"]]