tencent cloud

Tencent Cloud Super App as a Service

Getting Mini Program Categories

Download
Focus Mode
Font Size
Last updated: 2026-05-25 18:40:04
AI-Translated
Retrieves the mini program/mini game categories (primary + secondary) configured on the backend. Commonly used for category navigation or filtering.
Declaration: TMFMiniAppSDKManager.h

API

- (void)getTypeInfoExistMnpOnly:(BOOL)existMnpOnly
searchType:(TMASearchAppType)searchType
WithCompletion:(void (^)(NSArray<NSDictionary<NSString *, NSArray *> *> * _Nullable typeInfos,
NSError * _Nullable error))completion;

Parameters

Parameter
Description
existMnpOnly
YES : Returns only categories that contain mini programs (recommended for UI).NO : Returns all configured categories.
searchType
TMASearchAppTypeAll : Both. TMASearchAppTypeApp : Mini programs only. TMASearchAppTypeGame : Mini games only.
completion
On success, typeInfos is non-null and error is nil.

Return value

Each element in typeInfos is a dictionary of { primary category: [secondary categories, ...] }:
@[
@{ @"Tools" : @[@"Productivity", @"Utilities"] },
@{ @"Lifestyle" : @[@"Travel", @"Food"] },
]
Iterate over the array to access values. Do not merge them into a single dictionary. The secondary array may be empty (@[]).

Example

[[TMFMiniAppSDKManager sharedInstance] getTypeInfoExistMnpOnly:YES
searchType:TMASearchAppTypeApp
WithCompletion:^(NSArray<NSDictionary<NSString *, NSArray *> *> * _Nullable typeInfos,
NSError * _Nullable error) {
if (error) { return; }
for (NSDictionary<NSString *, NSArray *> *dic in typeInfos) {
[dic enumerateKeysAndObjectsUsingBlock:^(NSString *first, NSArray *second, BOOL *stop) {
// first: primary category; second: secondary category array
}];
}
}];
The retrieved category names can be passed directly to searchAppletsWithName:searchType:firstType:secondType:... for filtering.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback