
#pragma mark - 退出挽留 - Exit retention- (BOOL)shouldDetainUser:(TMFMiniAppInfo *)app;
{"detainConfig": [{"exitPage": "pages/order/*","content": "订单流程尚未完成,现在领取优惠券可享受更多优惠","exitButton": "暂时离开","enterButton": "领取优惠券","openType": "navigateTo","openLink": "/pages/coupon/claim?source=exit_detainment"}]}
{"exitPage": "*","content": "确定退出当前小程序吗?","exitButton": "退出","enterButton": "继续使用","openType": "reLaunch"}

// 点击胶囊按钮呼起的面板// 如果此方法不实现,则会调用showActionSheetWithTitle:cancelButtonTitle:cancelAction:otherButtonTitleAndActions:dismissBlock:presentingViewController:// @param app 小程序信息// @param cancelButtonTitle 取消标题// @param cancelAction 取消操作// @param otherButtonTitleAndActions 其他按钮及响应操作// @param dismissBlock 面板收起后需要执行的操作(一定要调用以保证功能正确!!!)// @param parentVC 呼起面板的vc - calls up the vc of the panel- (void)showMoreButtonActionSheetWithApp:(TMFMiniAppInfo *)appcancelButtonTitle:(nullable NSString *)cancelButtonTitlecancelAction:(nullable dispatch_block_t)cancelActionotherButtonTitleAndActions:(nullable NSArray *)otherButtonTitleAndActionsdismissBlock:(nullable dispatch_block_t)dismissBlockparentVC:(UIViewController *)parentVC;

//Superapp 可以自定义分享途径、决定展示顺序,目前使用在点击更多按钮、button组件(open-type="share")呼起的ActionSheet中// 1、默认渠道:QQ好友、QQ空间、微信、朋友圈(具体type参见MAUIDelegateShareViewType),由开发商决定,superapp 只能更改展示顺序// 2、自定义分享渠道:Superapp 自定义(type填MAUIDelegateShareViewTypeCustomizedShare,自定义MAShareTarget,建议大于100,在小程序页面中onShareAppMessage 回传分享内容,统一走shareMessageWithModel由 superapp 根据ShareTarget来分别处理)// 3、自定义事件:Superapp 自定义(type填MAUIDelegateShareViewTypeCustomizedAction)// 以上三种渠道展示顺序支持混排- (NSArray<TMASheetItemInfo *> *)customizedConfigForShare;
- (NSArray<TMASheetItemInfo *> *)customizedConfigForShare {NSMutableArray *arrays = [[NSMutableArray alloc] init];TMASheetItemInfo *item1 = [[TMASheetItemInfo alloc] initWithTitle:@"More sharing" type:MAUIDelegateShareViewTypeCustomizedShare shareTarget:100 shareKey:@"my"];item1.icon = [UIImage imageNamed:@"icon_moreOperation_shareChat"];[arrays addObject:item1];TMASheetItemInfo *item2 = [[TMASheetItemInfo alloc] initWithTitle:@"click" type:MAUIDelegateShareViewTypeCustomizedAction action:^(TMASheetActionParams * _Nullable params) {NSLog(@"click 点击");}];item2.icon = [UIImage imageNamed:@"icon_moreOperation_collect"];[arrays addObject:item2];return arrays;}

- (void)customizedConfigForMoreButtonActions:(NSMutableArray *)moreButtonTitleAndActions withApp:(TMFMiniAppInfo *)app{/*//增加一个自定义分享项TMASheetItemInfo *item = [[TMASheetItemInfo alloc] initWithTitle:@"Share" type:MAUIDelegateShareViewTypeCustomizedShare shareTarget:100 shareKey:@"my"];item.icon = [UIImage imageNamed:@"icon_moreOperation_shareChat"];[moreButtonTitleAndActions addObject:item];*//*//删除复制链接菜单NSMutableArray *newArrays = [[NSMutableArray alloc] initWithCapacity:moreButtonTitleAndActions.count];for (TMASheetItemInfo *item in moreButtonTitleAndActions) {if(item.type != MAUIDelegateShareViewTypeCopyLink) {[newArrays addObject:item];}}[moreButtonTitleAndActions removeAllObjects];[moreButtonTitleAndActions addObjectsFromArray:newArrays];*/}
- (TMAMoreMenuItem)visibleItemsForMoreMenuWithApp:(TMFMiniAppInfo *)app {// 只显示「设置」和「重启小程序」,隐藏其余内置项return TMAMoreMenuItemSetting | TMAMoreMenuItemRestart;}
- (BOOL)shouldHandleMoreMenuAction:(TMAMoreMenuAction)actionwithApp:(TMFMiniAppInfo *)appuserInfo:(nullable NSDictionary<NSString *, id> *)userInfo {if (action == TMAMoreMenuActionPerfPanel) {BOOL shown = [userInfo[TMAMoreMenuActionInfoPerfPanelCurrentlyShownKey] boolValue];NSLog(@"性能面板当前是否显示:%d", shown);return YES; // 自行接管,SDK 不再切换性能面板}return NO; // 其余动作走默认逻辑}
文档反馈