Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
Wyszukiwania zyskujące popularność
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Poznaj trendy
Aby uzyskać wyszukiwania zyskujące popularność, wywołaj metodę getTrendingSearches w obiekcie ContextualSearchRuntime. Ta metoda przyjmuje jeden parametr GetTrendingSearchesOptions, w którym można określić maksymalną liczbę zwracanych trendów.
Zwrócony obiekt SearchSuggestions nie zawiera żadnych właściwości dostępnych. Zawiera wszystkie informacje potrzebne do wyświetlania trendujących wyszukiwań, ale poza tym jest nieprzezroczysty.
Swift używa stylu równoczesności Swift, a Objective-C – funkcji wywołania zwrotnego.
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.
}];
Sieć reklamowa
Aby wyświetlić elementy wyszukiwań zyskujących popularność, użyj tego samego sposobu co w przypadku sugestii wyszukiwania.
Dalej: wyświetlanie wyników wyszukiwaniaarrow_forward
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-25 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-25 UTC."],[],["To retrieve trending searches, use the `getTrendingSearches` method of `ContextualSearchRuntime`, providing `GetTrendingSearchesOptions` to set the maximum results. Swift employs async/await, while Objective-C utilizes a completion handler. The `SearchSuggestions` object returned is opaque, solely intended for rendering. Display trending search chips similarly to search suggestions using the method described in another page. Both languages provide the necessary tools to retrieve and handle trending search data.\n"]]