/*** @brief SDK host app name.* This API is mainly used to indicate the app name.*/- (NSString *)appName;/*** @brief SDK host app version.* @return Returns a lowercase string, such as 1.0.0, is returned.*/- (NSString *)getAppVersion;/*** @brief The network status of the SDK host app.*/- (TMANetWorkStatus)getAppNetworkStatus;/*** @brief Model information of the SDK host app.*/- (NSString *)getAppIPhoneModel;/*** @brief Device information of the SDK host app.* @return format: {@"brand":@"iPhone",@"model":@"iPhone 11<iPhone12,1>",@"system":@"ios",@"platform":@"iOS 16.4.1"}*/- (NSDictionary *)getAppDeviceInfo;/*** @brief Obtains basic information of the host app.* @return format: {@"SDKVersion":@"2.32.2",@"model":@"iPhone 11<iPhone12,1>",@"system":@"ios",@"platform":@"iOS 16.4.1"}*/- (NSDictionary *)getAppBaseInfo;/*** @brief Obtains current language set by the host app.* @return format: "zh-Hans"*/- (NSString *)getCurrentLocalLanguage;/*** @brief If the current theme set by the host 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;// Sets the URL Scheme to open the host app of the mini program.- (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;}
Feedback