Trendler'i alma
Trend olan aramaları almak için ContextualSearchRuntime
üzerinde getTrendingSearches
yöntemini çağırın. Bu yöntem, döndürülen maksimum trend sayısı belirtebileceğiniz tek bir GetTrendingSearchesOptions alır.
Döndürülen SearchSuggestions
nesnesi erişilebilir özellik içermiyor. Trend olan aramaları oluşturmak için gerekli tüm bilgileri içerir ancak diğer açılardan şeffaf değildir.
Swift, Swift eşzamanlılık 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örüntülemek için arama önerileriyle aynı yönü kullanın.