【2025年1月2日】关于腾讯云小程序平台更名为腾讯云超级应用服务的公告
控制台更新动态
Android SDK 更新动态
iOS SDK 更新动态
Flutter 更新动态
IDE 更新动态
基础库更新动态
/*** @brief Superapp应用名称 - Superapp name* 此 API 提供用于文本显示的superapp名称 - Mainly used for copywriting prompts*/- (NSString *)appName;/*** @briefSuperapp版本 - Superapp version* @return 返回的是小写字符串,例如1.0.0 - 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 Superapp基础信息 - Get 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 Superapp设置的当前语言 - Get current language set by the Superapp* @return 格式 - format : "zh-Hans"*/- (NSString *)getCurrentLocalLanguage;/*** @brief Superapp设置的当前主题 如果不实现此方法 那么getAppBaseInfo中返回的theme为系统主题 - The current theme set by 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// 小程序最多保活的个数,默认是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;
// web-view组件中跳转非http/https时触发,用于处理web-view组件中特殊url的情况,比如打开其它App - Triggered when redirecting to non-http/https in the web-view component. Used to handle special URLs in the web-view component, such as opening other apps.// @param app {TMFMiniAppInfo} web-view组件所在的小程序信息 - Mini-program information where the web-view component is located// @param url {NSURL} 要打开的url - The url to open// @return 是否拦截处理 - Whether to intercept processing- (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;}
文档反馈