/*** @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;
- (void)applet:(TMFMiniAppInfo *)appletInfo screenCaptureStatusChanged:(BOOL)isCapture atPagePath:(NSString *)pagePath;- (void)appletDidTakeScreenshot:(TMFMiniAppInfo *)appletInfo atPagePath:(NSString *)pagePath;- (nullable UIView *)appletCustomizeWatermarkView:(TMFMiniAppInfo *)appletInfo;
// 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;}
//TMFMiniAppSDKDelegate protocol- (NSString *)stringWithConfigKey:(NSString *)key {if([key isEqualToString:TMA_SK_MINIAPP_ATS_Allow_Arbitrary_Loads]) {return @"1";}return nil;}
//TMFMiniAppSDKDelegate protocol- (NSString *)stringWithConfigKey:(NSString *)key {if([key isEqualToString:TMA_SK_MINIAPP_EnableDebug_Allow]) {return @"0";}return nil;}
//TMFMiniAppSDKDelegate protocol- (NSString *)stringWithConfigKey:(NSString *)key {if([key isEqualToString:TMA_SK_MINIAPP_NavigationItem_HidesSharedBackground]) {return @"1";}return nil;}
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