Trend Olan Aramalar

Trendler'i alma

Trend olan aramaları almak için getTrendingSearches yöntemini ContextualSearchRuntime üzerinde çağırın. Bu yöntemde, döndürülen trendlerin maksimum sayısını belirtebileceğiniz tek bir GetTrendingSearchesOptions kullanılır.

Döndürülen SearchSuggestions nesnesi, erişilebilir özellikler içermiyor. Trend olan aramaları oluşturmak için gerekli tüm bilgileri içerir ancak aksi takdirde opak olur.

Swift, Swift Concurrency stilini, Objective-C ise geri çağırma işlevini kullanır.

Swift

getTrendingSearches(withOptions:)

Task {
    let suggestions = try await searchRuntime.getTrendingSearches(
            withOptions: GetTrendingSearchesOptions())
}

Objective-C

getTrendingSearchesWithOptions

  [searchRuntime
      getTrendingSearchesWithOptions:
            [[GetTrendingSearchesOptions alloc] init]
                             completionHandler:^(SearchSuggestions *_Nullable suggestions,
                                                 NSError *_Nullable error) {
                              // error will be not null if there is an error.
                              // On success, suggestions will be non null.
                            }];

Görüntülü Reklam Ağı

Trend olan aramalar çiplerini göstermek için arama önerileriyle aynı yöntemi kullanın.

Sonraki: Arama sonuçlarını görüntüleme