tencent cloud

Feedback

Searching mini programs

Last updated: 2024-06-27 11:08:48
    The mini program SDK provides an online search API for mini programs. This API allows you to search for mini programs by keywords and categories.
    API description:
    Note:
    The 'SearchOptions' parameter is used to specify the keywords and category information for the mini program search;
    The 'MiniCallback' parameter is used to retrieve the search results of the mini program.
    /** * Search for a mini program * * @param searchOptions * @param callback */ public static void searchMiniApp(SearchOptions searchOptions, MiniCallback<List<MiniApp>> callback)

    Searching mini program by keyword

    Sample code:
    SearchOptions searchOptions = new SearchOptions("yourkeyword");
    TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback<List<MiniApp>>() {
       @Override
       public void value(int code, String msg, List<MiniApp> data) {
           if (code == MiniCode.CODE_OK && data != null) {
               //Search succeeded. The list is not empty
           }else{
               //Search failed. The list is empty
           }
        }
    });

    Searching by single category

    Sample code:
    SearchOptions searchOptions = new SearchOptions("","category name","");
    TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback<List<MiniApp>>() {
       @Override
       public void value(int code, String msg, List<MiniApp> data) {
           if (code == MiniCode.CODE_OK && data != null) {
               //Search succeeded. The list is not empty
           }else{
               //Search failed. The list is empty
           }
        }
    });

    Searching by dual category

    Note
    The results of a dual category search are the intersection of the two categories.
    Sample code:
    SearchOptions searchOptions = new SearchOptions("","category name","category name 2");
    TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback<List<MiniApp>>() {
       @Override
       public void value(int code, String msg, List<MiniApp> data) {
           if (code == MiniCode.CODE_OK && data != null) {
               //Search succeeded. The list is not empty
           }else{
               //Search failed. The list is empty
           }
        }
    });

    Searching by keyword and category

    Note
    When both keyword and category are set as search parameters, the results will be the intersection of the keyword and category.
    Sample code:
    SearchOptions searchOptions = new SearchOptions("keyword","category name","category name 2");
    TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback<List<MiniApp>>() {
       @Override
       public void value(int code, String msg, List<MiniApp> data) {
           if (code == MiniCode.CODE_OK && data != null) {
               //Search succeeded. The list is not empty
           }else{
               //Search failed. The list is empty
           }
        }
    });
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support