현재 하나의 클라이언트 ID는 하나의 검색 기능만 지원할 수 있습니다. 앱에서 여러 검색 기능을 사용하려면 여러 클라이언트 ID를 사용해야 합니다. 또한 앱의 여러 진입점에서 동일한 검색 기능을 사용하려면 트래픽을 구분하기 위해 각 진입점에 서로 다른 클라이언트 ID를 사용해야 합니다.
각 요청에 대해 GetSearchSuggestionsOptions
, GetTrendingSearchesOptions
또는 GetSearchContentOptions
에서 클라이언트 ID를 사전에 설정할 수 있으며 이 ID는 Info.plist
파일의 기본 클라이언트 ID를 재정의합니다(이 요청에만 해당).
Swift
getSearchSuggestions(withOptions:)
Task {
let options = GetSearchSuggestionsOptions(withTextContext:['Sample Query', 'Another query string'])
options.clientId = "client id"
let suggestions = try await searchRuntime.getSearchSuggestions(
withOptions: options)
}
Objective-C
getSearchSuggestionsWithOptions
GetSearchSuggestionsOptions *options = [[GetSearchSuggestionsOptions alloc] initWithTextContext: @[@'Sample Query', @'Another query string' ]];
options.clientId = [NSString stringWithFormat:@"client id"];
[searchRuntime
getSearchSuggestionsWithOptions:options
completionHandler:^(SearchSuggestions *_Nullable suggestions,
NSError *_Nullable error) {
// error will be not null if there is an error.
// On success, suggestions will be non null.
}];