// Default sharing channels after tapping the capsule button - includes MAShareTargetQQ, MAShareTargetQzone, MAShareTargetWXFriends, MAShareTargetWXMoment (the mini program configuration must be a subset of superapp)- (NSArray<NSNumber *> *)defaultSharingChannels;
- (NSArray<NSNumber *> *)defaultSharingChannels{return @[@(MAShareTargetQQ),@(MAShareTargetWXFriends),@(MAShareTargetWXMoment)];}
// In the superapp, you can customize the sharing channels and determine their display order. This feature is currently implemented in the ActionSheet triggered by tapping the More button or the button component (open-type="share").// 1. Default channels: QQ friends, Qzone, WeChat, and Moments (for specific types, see MAUIDelegateShareViewType). They are determined by the developer and the display order can only be changed within the superapp.// 2. Custom sharing channels: Customized in the superapp (set the type to MAUIDelegateShareViewTypeCustomizedShare, and when defining MAShareTarget, the value must be greater than 100. In the mini program page, onShareAppMessage will return the sharing content, which will be uniformly handled through shareMessageWithModel, allowing the superapp to process each ShareTarget individually.)// 3. Custom events: Customized in the superapp (set the type to MAUIDelegateShareViewTypeCustomizedAction).// The display order of the above three types of channels supports mixed arrangement- (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"];item1.shareTarget = 10001;[arrays addObject:item1];TMASheetItemInfo *item2 = [[TMASheetItemInfo alloc] initWithTitle:@"click" type:MAUIDelegateShareViewTypeCustomizedAction action:^(TMASheetActionParams * _Nullable params) {NSLog(@"click action triggered");}];item2.icon = [UIImage imageNamed:@"icon_moreOperation_collect"];[arrays addObject:item2];return arrays;}

/*** @brief - Share API* @param shareModel - Share model* @param appInfo - Mini program info* @param completionBlock - Callback*/- (void)shareMessageWithModel:(TMAShareModel *_Nonnull)shareModelappInfo:(TMFMiniAppInfo *_Nonnull)appInfocompletionBlock:(nullable void(^)(NSError * _Nullable error))completionBlock;
- (NSArray<TMASheetItemInfo *> *)customizedConfigForImageShare {TMASheetItemInfo *item = [[TMASheetItemInfo alloc] initWithTitle:@"Send to friend" type:MAUIDelegateShareViewTypeCustomizedShare shareTarget:200 shareKey:@"my"];TMASheetItemInfo *item2 = [[TMASheetItemInfo alloc] initWithTitle:@"test" type:MAUIDelegateShareViewTypeCustomizedAction shareTarget:201];item2.action = ^(TMASheetActionParams * _Nullable params0) {NSLog(@"");};return @[item,item2];}

Feedback