tencent cloud

All product documents
Tencent Cloud Super App as a Service
Searching Mini Programs
Last updated: 2025-02-24 19:34:38
Searching Mini Programs
Last updated: 2025-02-24 19:34:38
The mini program SDK provides an API for searching mini programs online by keywords and categories.
Note:
The firstType and secondType parameters are used to specify the primary category and secondary category for the mini programs to be searched.
The completion parameter is used to obtain the search results of the mini programs.
// Search the mini program

// @param name - Keywords in the search name
// @param completion - Search results
- (void)searchAppletsWithName:(NSString *)name
completion:(void (^)(NSArray<TMFAppletSearchInfo *> * _Nullable, NSError * _Nullable))completion;

// Search the mini program

// @param name - Keywords in the search name
// @param firstType - Primary category name
// @param secondType - Secondary category name
// @param completion - Search results
- (void)searchAppletsWithName:(NSString * _Nullable )name
firstType:(NSString * _Nullable)firstType
secondType:(NSString * _Nullable)secondType
completion:(void (^)(NSArray<TMFAppletSearchInfo *> * _Nullable, NSError * _Nullable))completion;

Search by keyword

Example:
[[TMFMiniAppSDKManager sharedInstance] searchAppletsWithName:searchString completion:^(NSArray<TMFAppletSearchInfo *> * _Nonnull result, NSError * _Nonnull aError) {
if (error) {
// Search failed, or the list is empty
} else {
// Search successful, list is not empty
}
}];

Search by a single category

Example:
[[TMFMiniAppSDKManager sharedInstance] searchAppletsWithName:nil firstType:@"firstType" secondType:nil completion:^(NSArray<TMFAppletSearchInfo *> * _Nullable info, NSError * _Nullable error) {
if (error) {
// Search failed, or the list is empty
} else {
// Search successful, list is not empty
}
}];

Search by dual categories

Note:
The result will be the intersection of the two categories.
Example:
[[TMFMiniAppSDKManager sharedInstance] searchAppletsWithName:nil firstType:@"firstType" secondType:@"secondType" completion:^(NSArray<TMFAppletSearchInfo *> * _Nullable info, NSError * _Nullable error) {
if (error) {
// Search failed, or the list is empty
} else {
// Search successful, list is not empty
}
}];


Specify search scope

Note:
You can specify a search for mini programs and mini games, or only mini programs or mini games.
/**
Type, i.e., mini programs or mini games
- TMAAppTypeApp: Mini programs
- TMAAppTypeGame: Mini games
*/

typedef NS_ENUM(int32_t, TMASearchAppType) {
TMASearchAppTypeAll = 0,
TMASearchAppTypeApp = 1,
TMASearchAppTypeGame = 2,
};

// Search the mini program

// @param name - Keywords in the search name
// @param searchType - Search scope, i.e., mini programs or mini games
// @param firstType - Primary category name
// @param secondType - Secondary category name
// @param completion - Search results
- (void)searchAppletsWithName:(NSString * _Nullable )name
searchType:(TMASearchAppType)searchType
firstType:(NSString * _Nullable)firstType
secondType:(NSString * _Nullable)secondType
completion:(void (^)(NSArray<TMFAppletSearchInfo *> * _Nullable, NSError * _Nullable))completion;
// Gets the mini program category information

// @param existMnpOnly - Whether to return only mini program results
// @param searchType - Search scope, i.e., mini programs or mini games
// @param completion - The search results by category
- (void)getTypeInfoExistMnpOnly:(BOOL)existMnpOnly
searchType:(TMASearchAppType)searchType

WithCompletion:(void (^)(NSArray<nsdictionary><nsstring *,nsarray *> *> * _Nullable, NSError * _Nullable))completion;



Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

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 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon