tencent cloud

Tencent Cloud Super App as a Service

Others

PDF
Focus Mode
Font Size
Last updated: 2026-03-20 18:44:06

Superapp APIs

/**
* @brief The superapp name
* This API provides the superapp name for display in text.
*/
- (NSString *)appName;

/**
* @brief The superapp version
* @return Returns a lowercase string, such as 1.0.0.
*/
- (NSString *)getAppVersion;

/**
* @brief The network status
*/

- (TMANetWorkStatus)getAppNetworkStatus;

/**
* @brief The model information
*/
- (NSString *)getAppIPhoneModel;

/**
* @brief The device information
* @return Format: {@"brand":@"iPhone",@"model":@"iPhone 11<iPhone12,1>",@"system":@"ios",@"platform":@"iOS 16.4.1"}
*/
- (NSDictionary *)getAppDeviceInfo;
/**
* @brief Gets basic information of the superapp
* @return Format: {@"SDKVersion":@"2.32.2",@"model":@"iPhone 11<iPhone12,1>",@"system":@"ios",@"platform":@"iOS 16.4.1"}
*/
- (NSDictionary *)getAppBaseInfo;

/**
* @brief Gets the current language set in the superapp
* @return Format: "zh-Hans"
*/
- (NSString *)getCurrentLocalLanguage;


/**
* @brief The current theme set in the superapp. If this method is not implemented, the theme returned in getAppBaseInfo will be the system theme.
*/
- (NSString *)getAppTheme;

/**
* @brief Clipboard frequency control
*/
- (NSNumber *)getClipboardInterval

// The maximum number of active mini programs. Default value: 3.

- (NSInteger)maxMiniAppKeepAliveCount;

// Superapp URL scheme

- (NSString *)getAppScheme;

Screen capture, screen recording and watermarking

- (void)applet:(TMFMiniAppInfo *)appletInfo screenCaptureStatusChanged:(BOOL)isCapture atPagePath:(NSString *)pagePath;

- (void)appletDidTakeScreenshot:(TMFMiniAppInfo *)appletInfo atPagePath:(NSString *)pagePath;

- (nullable UIView *)appletCustomizeWatermarkView:(TMFMiniAppInfo *)appletInfo;

Process special URLs in web-view component

Special URLs in web-view component pages should be passed to the superapp for processing.
// Triggered when redirecting to non-http/https in the web-view component. It is used to process special URLs in the web-view component, such as opening other apps.
// @param app {TMFMiniAppInfo} Information about the mini program where the web-view component is located.
// @param url {NSURL} The URL to be accessed.
// @return Whether to intercept.
- (BOOL)webViewCustomUrlLoading:(TMFMiniAppInfo *)app url:(NSURL *)url {
NSLog(@"webViewCustomUrlLoading:%@,appid:%@",[url absoluteString],app.appId);
if ([[UIApplication sharedApplication] canOpenURL:url]) {
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
if (success) {
NSLog(@"webViewCustomUrlLoading:%@,appid:%@, open sucess",[url absoluteString],app.appId);
}
}];
} else {
[[UIApplication sharedApplication] openURL:url];
}
return YES;
} else {
NSLog(@"webViewCustomUrlLoading:%@,appid:%@,cann't open!!!",[url absoluteString],app.appId);
}
return NO;
}

Compatibility for HTTP resources on iOS 18 and above

Superapp can be configured to disable all mini program debugging features, including debug switches and remote debugging.
//TMFMiniAppSDKDelegate protocol
- (NSString *)stringWithConfigKey:(NSString *)key {
if([key isEqualToString:TMA_SK_MINIAPP_ATS_Allow_Arbitrary_Loads]) {
return @"1";
}
return nil;
}

Disable mini-program debugging features

Superapp can be configured to disable all mini program debugging-related features, including debug entrance and remote debugging, via delegate API.

//TMFMiniAppSDKDelegate protocol
- (NSString *)stringWithConfigKey:(NSString *)key {
if([key isEqualToString:TMA_SK_MINIAPP_EnableDebug_Allow]) {
return @"0";
}
return nil;
}

Change the display style of navigation bar buttons in iOS 26 and above

On iOS 26 and above, the navigation bar buttons have a frosted glass effect by default. The superapp can be configured to disable this effect via delegate API to maintain consistency with previous versions.

//TMFMiniAppSDKDelegate protocol
- (NSString *)stringWithConfigKey:(NSString *)key {
if([key isEqualToString:TMA_SK_MINIAPP_NavigationItem_HidesSharedBackground]) {
return @"1";
}
return nil;
}



Help and Support

Was this page helpful?

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

Feedback