SearchInAppsSDK Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GetSearchContentOptions
@objc
final class GetSearchContentOptions
This class contains all the options necessary to request search content.
-
The number of content blocks to request. The number returned may be fewer than this. Defaults to 1.
Declaration
Swift
@objc
final var blockCount: Int
-
The client ID used to request search content if it is different from the
client ID specified in Info.plist.
Declaration
Swift
@objc
final var clientId: String?
-
Creates options with given location data (i.e. the location context used for generating
location-based search suggestions).
-
Creates options with given search repeat text (i.e. the string used for generating the Google
search query).
Declaration
Swift
@objc
init(searchRepeat: String)
-
Create options with a given text context (i.e. the strings used for generating search
content).
Declaration
Swift
@objc
init(textContext: [String])
-
The information used to generate location-based search suggestions.
-
The search repeat text used to generate the Google search query. The returned query might not
be exactly the same as the search repeat text.
Declaration
Swift
@objc
final var searchRepeat: String?
-
The text used to generate query-based search suggestions.
Declaration
Swift
@objc
final var textContext: [String]?
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\u003e\u003ccode\u003eGetSearchContentOptions\u003c/code\u003e enables requesting search content with various parameters like location, text, and client ID.\u003c/p\u003e\n"],["\u003cp\u003eIt allows customization of the request by specifying the number of content blocks (\u003ccode\u003eblockCount\u003c/code\u003e) and alternative client IDs (\u003ccode\u003eclientId\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can initialize \u003ccode\u003eGetSearchContentOptions\u003c/code\u003e with location context, search repeat text, or text context for generating tailored search suggestions.\u003c/p\u003e\n"],["\u003cp\u003eLocation-based search suggestions are driven by \u003ccode\u003elocationContext\u003c/code\u003e, while \u003ccode\u003esearchRepeat\u003c/code\u003e provides text used for Google search query generation.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003etextContext\u003c/code\u003e offers text strings for generating query-based search suggestions, potentially enhancing search relevance and diversity.\u003c/p\u003e\n"]]],["`GetSearchContentOptions` manages search content requests. Key options include `blockCount`, which dictates the number of content blocks requested (defaulting to 1), and `clientId`, for specifying an alternative client ID. The class provides initializers for different search contexts: `locationContext` for location-based suggestions, `searchRepeat` for Google query generation, and `textContext` for query-based suggestions. Additionally, you can use properties `locationContext`, `searchRepeat` or `textContext` to specify the different contexts.\n"],null,["# SearchInAppsSDK Framework Reference\n\nGetSearchContentOptions\n=======================\n\n @objc\n final class GetSearchContentOptions\n\nThis class contains all the options necessary to request search content.\n- `\n ``\n ``\n `\n\n ### [blockCount](#/c:@M@SearchInAppsSDK@objc(cs)GetSearchContentOptions(py)blockCount)\n\n `\n ` \n The number of content blocks to request. The number returned may be fewer than this. Defaults to 1. \n\n #### Declaration\n\n Swift \n\n @objc\n final var blockCount: Int\n\n- `\n ``\n ``\n `\n\n ### [clientId](#/c:@M@SearchInAppsSDK@objc(cs)GetSearchContentOptions(py)clientId)\n\n `\n ` \n The client ID used to request search content if it is different from the\n client ID specified in Info.plist. \n\n #### Declaration\n\n Swift \n\n @objc\n final var clientId: String?\n\n- `\n ``\n ``\n `\n\n ### [init(locationContext:)](#/c:@M@SearchInAppsSDK@objc(cs)GetSearchContentOptions(im)initWithLocationContext:)\n\n `\n ` \n Creates options with given location data (i.e. the location context used for generating\n location-based search suggestions). \n\n #### Declaration\n\n Swift \n\n @objc\n init(locationContext: [../Classes/LocationSuggestionsContext.html])\n\n- `\n ``\n ``\n `\n\n ### [init(searchRepeat:)](#/c:@M@SearchInAppsSDK@objc(cs)GetSearchContentOptions(im)initWithSearchRepeat:)\n\n `\n ` \n Creates options with given search repeat text (i.e. the string used for generating the Google\n search query). \n\n #### Declaration\n\n Swift \n\n @objc\n init(searchRepeat: String)\n\n- `\n ``\n ``\n `\n\n ### [init(textContext:)](#/c:@M@SearchInAppsSDK@objc(cs)GetSearchContentOptions(im)initWithTextContext:)\n\n `\n ` \n Create options with a given text context (i.e. the strings used for generating search\n content). \n\n #### Declaration\n\n Swift \n\n @objc\n init(textContext: [String])\n\n- `\n ``\n ``\n `\n\n ### [locationContext](#/c:@M@SearchInAppsSDK@objc(cs)GetSearchContentOptions(py)locationContext)\n\n `\n ` \n The information used to generate location-based search suggestions. \n\n #### Declaration\n\n Swift \n\n @objc\n final var locationContext: [../Classes/LocationSuggestionsContext.html]?\n\n- `\n ``\n ``\n `\n\n ### [searchRepeat](#/c:@M@SearchInAppsSDK@objc(cs)GetSearchContentOptions(py)searchRepeat)\n\n `\n ` \n The search repeat text used to generate the Google search query. The returned query might not\n be exactly the same as the search repeat text. \n\n #### Declaration\n\n Swift \n\n @objc\n final var searchRepeat: String?\n\n- `\n ``\n ``\n `\n\n ### [textContext](#/c:@M@SearchInAppsSDK@objc(cs)GetSearchContentOptions(py)textContext)\n\n `\n ` \n The text used to generate query-based search suggestions. \n\n #### Declaration\n\n Swift \n\n @objc\n final var textContext: [String]?"]]