/*** @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.// The maximum number of mini programs that can be kept alive, the default is 3- (NSInteger)maxMiniAppKeepAliveCount;// Superapp URL Scheme// Set the 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;}
- (NSString *)stringWithConfigKey:(NSString *)key {if ([key isEqualToString:TMA_SK_MINIAPP_WebView_DomainError_PagePath]) {return [[NSBundle mainBundle] pathForResource:@"my_error_page"ofType:@"html"inDirectory:@"Resource/jssdk"];}return nil;}
<script>var msg = decodeURIComponent(new URLSearchParams(location.search).get('msg') || '');document.getElementById('tip').innerText = msg;</script>
- (nullable NSString *)miniGameJSPreludeForAppInfo:(TMFMiniAppInfo *)appInfo {// Differentiate mini games by appInfo.appIdreturn @"(function(){ globalThis.__HOST_ENV__ = { channel: demo' }; })();";}
フィードバック