/*** Mini program search** @param searchOptions* @param callback*/public static void searchMiniApp(SearchOptions searchOptions, MiniCallback<List<MiniApp>> callback)
SearchOptions searchOptions = new SearchOptions("yourkeyword");TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback<List<MiniApp>>() {@Overridepublic void value(int code, String msg, List<MiniApp> data) {if (code == MiniCode.CODE_OK && data != null) {// Search successful, list is not empty}else{// Search failed, or the list is empty}}});
SearchOptions searchOptions = new SearchOptions("","Category name","");TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback<List<MiniApp>>() {@Overridepublic void value(int code, String msg, List<MiniApp> data) {if (code == MiniCode.CODE_OK && data != null) {// Search successful, list is not empty}else{// Search failed, or the list is empty}}});
SearchOptions searchOptions = new SearchOptions("","Category name","Category name 2");TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback<List<MiniApp>>() {@Overridepublic void value(int code, String msg, List<MiniApp> data) {if (code == MiniCode.CODE_OK && data != null) {// Search successful, list is not empty}else{// Search failed, or the list is empty}}});
SearchOptions searchOptions = new SearchOptions("keyword","Category name","Category name 2");TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback<List<MiniApp>>() {@Overridepublic void value(int code, String msg, List<MiniApp> data) {if (code == MiniCode.CODE_OK && data != null) {// Search successful, list is not empty}else{// Search failed, or the list is empty}}});
// Specify search for mini gamesSearchOptions searchOptions = new SearchOptions("keyword", "Category name", "Category name 2");searchOptions.engineType = MiniEngineType.MiniGame;TmfMiniSDK.searchMiniApp(searchOptions, new MiniCallback<List<MiniApp>>() {@Overridepublic void value(int code, String msg, List<MiniApp> data) {if (code == MiniCode.CODE_OK && data != null) {// Search successful, list is not empty}else{// Search failed, or the list is empty}}});
SearchOptions searchOptions = new SearchOptions("keyword", "Category name", "Category name 2");searchOptions.pageIndex = index; // Page numbersearchOptions.pageSize = size; // Page sizeTmfMiniSDK.searchMiniApp2(searchOptions, new MiniCallback<SearchResult>() {@Overridepublic void value(int code, String msg, SearchResult data) {if (code == MiniCode.CODE_OK && data != null && data.miniAppList != null) {// Search successful, list is not empty//data.total: Total number of matched mini programs, can be used to calculate the number of pages//data.miniAppList: List of mini programs on the current page} else {// Search failed, or the list is empty}}});
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback