- (void)appletDidTakeScreenshot:(TMFMiniAppInfo *)appletInfo atPagePath:(NSString *)pagePath;
- (void)applet:(TMFMiniAppInfo *)appletInfo screenCaptureStatusChanged:(BOOL)isCapture atPagePath:(NSString *)pagePath;
- (nullable UIView *)appletCustomizeWatermarkView:(TMFMiniAppInfo *)appletInfo
@interface MiniAppDemoSDKDelegateImpl : NSObject <TMFMiniAppSDKDelegate>+ (instancetype)sharedInstance;// Weak reference to the currently mounted watermark. The watermark is strongly referenced by its parent view.@property (nonatomic, weak, nullable) UIView *watermarkView;// Whether to display the watermark currently@property (nonatomic, assign) BOOL shouldShowWatermark;@end
- (void)applet:(TMFMiniAppInfo *)appletInfo screenCaptureStatusChanged:(BOOL)isCapture atPagePath:(NSString *)pagePath {// Ensure that the status of the watermarkView mounted on the page can be modifieddispatch_block_t updateWatermark = ^{self.shouldShowWatermark = isCapture;self.watermarkView.hidden = !isCapture;};if ([NSThread isMainThread]) {updateWatermark();} else {dispatch_async(dispatch_get_main_queue(), updateWatermark);}}
/// Watermark View: Hidden by default, displayed by screenCaptureStatusChanged: only during screen recording- (nullable UIView *)appletCustomizeWatermarkView:(TMFMiniAppInfo *)appletInfo {// This method may be called multiple times. Remove the watermark previously created by this example.[self.watermarkView removeFromSuperview];// Prevent incorrect initial status when entering the page after screen recording has already started.self.shouldShowWatermark = UIScreen.mainScreen.isCaptured;UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 190, 32)];container.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.45];container.layer.cornerRadius = 6;container.layer.masksToBounds = YES;container.userInteractionEnabled = NO;container.hidden = !self.shouldShowWatermark;UILabel *watermark = [[UILabel alloc] initWithFrame:container.bounds];watermark.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;watermark.text = @"TCMPP SDK Demo";watermark.textColor = [UIColor whiteColor];watermark.textAlignment = NSTextAlignmentCenter;watermark.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];[container addSubview:watermark];self.watermarkView = container;return container;}

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