सबसे ज़्यादा खोजे गए चैनल

ट्रेंडिंग खोजें पाना

ट्रेंडिंग खोजें पाने के लिए, ContextualSearchRuntime पर getTrendingSearches तरीके को कॉल करें. इस तरीके में, GetTrendingSearchesOptions का इस्तेमाल किया जाता है. इसमें, ट्रेंडिंग खोजों की ज़्यादा से ज़्यादा संख्या तय की जा सकती है.

SearchSuggestions ऑब्जेक्ट में, ऐक्सेस की जा सकने वाली कोई प्रॉपर्टी नहीं होती. इसमें ट्रेंडिंग खोजें दिखाने के लिए, ज़रूरी सभी जानकारी होती है. हालांकि, इसके अलावा यह अपारदर्शी होती है.

Swift, Swift Concurrency स्टाइल का इस्तेमाल करता है. वहीं, Objective-C, कॉलबैक फ़ंक्शन का इस्तेमाल करता है.

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.
                            }];

डिसप्ले

ट्रेंडिंग खोजों की चिप दिखाने के लिए, खोज के सुझावों की तरह ही तरीका अपनाएं.

अगला लेख: खोज के नतीजे दिखाना