分享设置
U-Share为开发者提供了不同种类的分享样式,分享目前支持的类型有:
分享设置
分享样式支持
U-Share为开发者提供了不同种类的分享样式,分享目前支持的类型有:
网页链接(网页H5链接)
小程序(包括微信小程序和QQ小程序两种)
图片
纯文本
图文(包含一张图片和一段文本)
视频(只支持视频URL、缩略图及描述)
音乐(只支持音乐URL、缩略图及描述)
表情(GIF图片,即Emotion类型,只有微信支持)
以下是不同分享样式的具体实现代码:
分享网页链接
-(void)shareWebPageToPlatformType:(UMSocialPlatformType)platformType
{
//创建分享消息对象
UMSocialMessageObject*messageObject =[UMSocialMessageObject messageObject];
//创建网页内容对象
UMShareWebpageObject*shareObject =[UMShareWebpageObject shareObjectWithTitle:@"分享标题" descr:@"分享内容描述" thumImage:[UIImage imageNamed:@"icon"]];
//设置网页地址
shareObject.webpageUrl =@"http://mobile.umeng.com/social";
//分享消息对象设置分享内容对象
messageObject.shareObject = shareObject;
//调用分享接口
[[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data,NSError*error){
if(error){
NSLog(@"************Share fail with error %@*********",error);
}else{
NSLog(@"response data is %@",data);
}
}];
}集成U-Share能够实现从App分享H5页面到微信/QQ等平台,如想实现从微信等回流到App,统计分享带来了多少的新老用户以及自动绑定邀请关系,请集成U-Link产品,可在U-Share产品后台查看分享回流次数、分享新增用户等指标。
分享小程序
小程序支持分享到QQ和微信两个平台
-(void)shareMiniProgramToPlatformType:(UMSocialPlatformType)platformType
{
//创建分享消息对象
UMSocialMessageObject*messageObject =[UMSocialMessageObject messageObject];
UMShareMiniProgramObject*shareObject =[UMShareMiniProgramObject shareObjectWithTitle:@"小程序标题" descr:@"小程序内容描述" thumImage:[UIImage imageNamed:@"icon"]];
shareObject.webpageUrl =@"兼容微信低版本网页地址";
shareObject.userName =@"小程序username,如 gh_3ac2059ac66f";
shareObject.path =@"小程序页面路径,如 pages/page10007/page10007";
messageObject.shareObject = shareObject;
shareObject.hdImageData =[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"logo" ofType:@"png"]];
shareObject.miniProgramType =UShareWXMiniProgramTypeRelease;// 可选体验版和开发板
//调用分享接口
[[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data,NSError*error){
if(error){
UMSocialLogInfo(@"************Share fail with error %@*********",error);
}else{
if([data isKindOfClass:[UMSocialShareResponseclass]]){
UMSocialShareResponse*resp = data;
//分享结果消息
UMSocialLogInfo(@"response message is %@",resp.message);
//第三方原始返回的数据
UMSocialLogInfo(@"response originalResponse data is %@",resp.originalResponse);
}else{
UMSocialLogInfo(@"response data is %@",data);
}
}
[self alertWithError:error];
}];
}分享图片
-(void)shareImageToPlatformType:(UMSocialPlatformType)platformType
{
//创建分享消息对象
UMSocialMessageObject*messageObject =[UMSocialMessageObject messageObject];
//创建图片内容对象
UMShareImageObject*shareObject =[[UMShareImageObject alloc] init];
//如果有缩略图,则设置缩略图
shareObject.thumbImage =[UIImage imageNamed:@"icon"];
[shareObject setShareImage:@"https://mobile.umeng.com/images/pic/home/social/img-1.png"];
//分享消息对象设置分享内容对象
messageObject.shareObject = shareObject;
//调用分享接口
[[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data,NSError*error){
if(error){
NSLog(@"************Share fail with error %@*********",error);
}else{
NSLog(@"response data is %@",data);
}
}];
}分享纯文本
-(void)shareTextToPlatformType:(UMSocialPlatformType)platformType
{
//创建分享消息对象
UMSocialMessageObject*messageObject =[UMSocialMessageObject messageObject];
//设置文本
messageObject.text =@"社会化组件UShare将各大社交平台接入您的应用,快速武装App。";
//调用分享接口
[[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data,NSError*error){
if(error){
NSLog(@"************Share fail with error %@*********",error);
}else{
NSLog(@"response data is %@",data);
}
}];
}分享图文
-(void)shareImageAndTextToPlatformType:(UMSocialPlatformType)platformType
{
//创建分享消息对象
UMSocialMessageObject*messageObject =[UMSocialMessageObject messageObject];
//设置文本
messageObject.text =@"社会化组件UShare将各大社交平台接入您的应用,快速武装App。";
//创建图片内容对象
UMShareImageObject*shareObject =[[UMShareImageObject alloc] init];
//如果有缩略图,则设置缩略图
shareObject.thumbImage =[UIImage imageNamed:@"icon"];
[shareObject setShareImage:@"https://www.umeng.com/img/index/demo/1104.4b2f7dfe614bea70eea4c6071c72d7f5.jpg"];
//分享消息对象设置分享内容对象
messageObject.shareObject = shareObject;
//调用分享接口
[[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data,NSError*error){
if(error){
NSLog(@"************Share fail with error %@*********",error);
}else{
NSLog(@"response data is %@",data);
}
}];
}分享视频
-(void)shareVedioToPlatformType:(UMSocialPlatformType)platformType
{
//创建分享消息对象
UMSocialMessageObject*messageObject =[UMSocialMessageObject messageObject];
//创建视频内容对象
UMShareVideoObject*shareObject =[UMShareVideoObject shareObjectWithTitle:@"分享标题" descr:@"分享内容描述" thumImage:[UIImage imageNamed:@"icon"]];
//设置视频网页播放地址
shareObject.videoUrl =@"http://video.sina.com.cn/p/sports/cba/v/2013-10-22/144463050817.html";
// shareObject.videoStreamUrl = @"这里设置视频数据流地址(如果有的话,而且也要看所分享的平台支不支持)";
//分享消息对象设置分享内容对象
messageObject.shareObject = shareObject;
//企业微信和抖音的设置视频的数据
NSString* path =[[NSBundle mainBundle] pathForResource:@"video" ofType:@"mp4"];
NSData* videoData =[NSData dataWithContentsOfFile:path];
shareObject.videoName =@"video.mp4";
shareObject.videoData = videoData;
//调用分享接口
[[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data,NSError*error){
if(error){
NSLog(@"************Share fail with error %@*********",error);
}else{
NSLog(@"response data is %@",data);
}
}];
}分享音乐
-(void)shareMusicToPlatformType:(UMSocialPlatformType)platformType
{
//创建分享消息对象
UMSocialMessageObject*messageObject =[UMSocialMessageObject messageObject];
//创建音乐内容对象
UMShareMusicObject*shareObject =[UMShareMusicObject shareObjectWithTitle:@"分享标题" descr:@"分享内容描述" thumImage:[UIImage imageNamed:@"icon"]];
//设置音乐网页播放地址
shareObject.musicUrl =@"http://c.y.qq.com/v8/playsong.html?songid=108782194&source=yqq#wechat_redirect";
// shareObject.musicDataUrl = @"这里设置音乐数据流地址(如果有的话,而且也要看所分享的平台支不支持)";
//分享消息对象设置分享内容对象
messageObject.shareObject = shareObject;
//调用分享接口
[[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data,NSError*error){
if(error){
NSLog(@"************Share fail with error %@*********",error);
}else{
NSLog(@"response data is %@",data);
}
}];
}分享微信表情
-(void)shareEmoticonToPlatformType:(UMSocialPlatformType)platformType
{
UMSocialMessageObject*messageObject =[UMSocialMessageObject messageObject];
UMShareEmotionObject*shareObject =[UMShareEmotionObject shareObjectWithTitle:UMS_Title descr:UMS_Text thumImage:nil];
NSString*filePath =[[NSBundle mainBundle] pathForResource:@"gifFile"
ofType:@"gif"];
NSData*emoticonData =[NSData dataWithContentsOfFile:filePath];
shareObject.emotionData = emoticonData;
messageObject.shareObject = shareObject;
//调用分享接口
[[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data,NSError*error){
if(error){
NSLog(@"************Share fail with error %@*********",error);
}else{
if([data isKindOfClass:[UMSocialShareResponseclass]]){
UMSocialShareResponse*resp = data;
//分享结果消息
NSLog(@"response message is %@",resp.message);
}else{
NSLog(@"response data is %@",data);
}
}
}];
}示例
分享文本到微信:
#import <UMShare/UMShare.h>
-(void)shareTextToWechat
{
NSString*text =@"社会化组件U-Share将各大社交平台接入您的应用,快速武装App。";
UMSocialMessageObject*messageObject =[UMSocialMessageObject messageObject];
messageObject.text = text;
[[UMSocialManager defaultManager] shareToPlatform:UMSocialPlatformType_WechatSession messageObject:messageObject currentViewController:self completion:^(id data,NSError*error){
NSString*message =nil;
if(!error){
message =[NSString stringWithFormat:@"分享成功"];
}else{
message =[NSString stringWithFormat:@"失败原因Code: %d\n",(int)error.code];
}
UIAlertView*alert =[[UIAlertView alloc] initWithTitle:@"share"
message:message
delegate:nil
cancelButtonTitle:NSLocalizedString(@"确定",nil)
otherButtonTitles:nil];
[alert show];
}];
}第三方平台分享说明
所有平台分享样式总览
平台 | 纯文本 | 图片 | 图文 | Web链接 | 视频链接 | 音乐链接 | 其他 |
|---|---|---|---|---|---|---|---|
微信好友 | √ | √ | × | √ | √ | √ | 微信小程序、gif表情及文件 |
微信朋友圈 | √ | √ | × | √ | √ | √ | - |
微信收藏 | √ | √ | × | √ | √ | √ | 文件 |
新浪微博 | √ | √ | √ | √ | √ | √ | - |
√ | √ | × | √ | √ | √ | QQ小程序 | |
QQ空间 | √ | √ | × | √ | √ | √ | - |
支付宝 | √ | √ | × | √ | √ | √ | - |
钉钉 | √ | √ | × | √ | × | × | - |
企业微信 | √ | √ | × | √ | √ | √ | 文件 |
抖音 | × | √ | × | × | √ | × | 视频只能分享本地视频内容 |
易信 | √ | √ | × | √ | √ | √ | - |
有道云笔记 | √ | √ | √ | × | × | × | 文件 |
印象笔记 | √ | √ | √ | √ | √ | √ | 文件 |
有道云笔记 | √ | √ | √ | √ | √ | √ | - |
Linkedin(领英) | √ | √ | √ | √ | √ | √ | 图片链接必须为网络链接,不支持本地图片 |
√ | √ | √ | √ | √ | √ | - | |
FaceBookMessenger | × | √ | √ | √ | √ | √ | - |
√ | √ | √ | √ | √ | √ | - | |
× | √ | × | × | × | × | - | |
Kakao | √ | √ | √ | × | × | × | - |
Line | √ | √ | √ | × | × | × | - |
Tumblr | √ | × | × | × | × | × | - |
× | √ | × | × | × | × | 图片必须为网络链接 | |
√ | √ | × | × | × | × | - | |
Flickr | × | √ | × | × | × | × | - |
Google+ | √ | √ | × | √ | √ | √ | - |
× | √ | × | √ | √ | √ | 图片为网络链接 | |
VKontakte | √ | √ | × | √ | √ | √ | - |
DropBox | √ | √ | × | √ | √ | √ | 文件 |
短信 | √ | √ | √ | √ | √ | √ | - |
邮件 | √ | √ | √ | √ | √ | √ | - |
QQ分享
如果分享的url中含有中文字符,需要将中文部分进行url转码后可正常分享。如:https://www.umeng.com/U-Share分享需要将「分享」二字进行url转码放在链接中再进行分享,如下:https://www.umeng.com/U-Share分享
微博分享
分享LinkCard(网页、音乐、视频链接分享)
进行网页链接分享是多数应用进行推广和分享的形式,包含了标题、描述和缩略图,不像微信和QQ平台分享后会显示一张Card形式的消息,点开后会打开连接。微博的形式略有不同。
什么是LinkCard在微博消息流内,分享一条链接,该链接将解析为包含一个对象数据的特殊短链,且该对象数据可以在微博消息流内显示并交互,这种形态就是微博消息流LinkCard解析。 参考微博-移动客户端接入
分享网页类型数据之后不显示缩略图 是什么原因这属于微博的移动应用商务合作,移动SDK中的LinkCard和附件栏集成分享权限需要合作申请,对接请联系微博商务:yinle@staff.weibo.com
Facebook分享
当前支持分享图片、链接及本地视频。图片及本地视频类型仅可在安装应用时分享,链接类型可在未安装应用时分享。
图片
照片大小必须小于 12MB。
用户需要安装版本 7.0 或以上的原生 iOS 版 Facebook 应用。
仅可在安装 App 时分享。
网页链接
目前仅可设置URL,标题、描述及缩略图又SDK从URL目标站点获取。
可在未安装 App 时分享。
视频
视频大小必须小于 12MB。
分享内容的用户应安装版本 26.0 或以上的 iOS 版 Facebook 客户端。
分享视频必须为本地资源,即从用户相册中获取的视频URL。
URL格式类似:
assets-library://asset/asset.MOV?id=3046C424-1C3B-42E7-9404-5B8DC30BB584&ext=MOV。仅可在安装 App 时分享。
可参考最新 demo 中 Facebook 分享视频。
Messenger 分享
Messenger 仅可在 App 安装时分享。
Messenger 可分享图片及网页链接类型,要求与 Facebook 相同。
分享到 Messenger 中只有“完成”按钮,没有“取消”按钮,只有在手动进行 App 切换时,从 Messenger 切换回原 App 才会回调取消事件。
可参考最新 demo 中 Messenger 分享。
Tumblr分享
Tumblr 可分享文本、本地图片、多图(最多10张)、GIF类型。
分享图片均可同时携带文本。
Tumblr 以 ShareExtension 方式进入系统分享界面。
进入 ShareExtension 后的返回只有分享完成的回调,没有取消回调。
分享面板使用
调用分享面板
用户点击分享按钮时,首先会调起一个分享面板让用户选择分享平台。U-Share为开发者提供了免费的分享面板功能,开发者可以免去自己配置分享面板的步骤。当然您也可以不使用U-Share的分享面板功能,开发者可以自己写分享按钮或者触发时间,然后调用U-Share的分享方法进行分享。以下是调用分享面板的方法:您需要在分享按钮绑定如下触发代码
#import <UShareUI/UShareUI.h>
//显示分享面板
[UMSocialUIManager showShareMenuViewInWindowWithPlatformSelectionBlock:^(UMSocialPlatformType platformType,NSDictionary*userInfo){
// 根据获取的platformType确定所选平台进行下一步操作
}];以下是调用分享面板时的一些注意事项:1.创建Xcode项目会默认添加Main.storyboard作为Main Interface(General - Deployment Info),也就是项目的主Window。2.如果没使用Main.storyboard而又另外在AppDelegate中创建了UIWindow对象,如
self.window =[[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]如果项目中同时出现Main Interface以及代码创建UIWindow会导致分享面板无法正常弹出,解决方法是移除其一即可。3.使用presentViewController或其他无法显示分享面板的情况,参考设置分享面板代理一节修改父窗口回调为self.view或其他指定视图。如果遇到分享面板未显示,请参考分享面板无法弹出
自定义分享面板显示的分享平台
为避免应用审核被拒,仅会对有效的平台进行显示,如平台应用未安装,或平台应用不支持等会进行隐藏。由于以上原因,在模拟器上部分平台会隐藏。
用户能够在分享面板选择他想要分享的社交平台,以下方法可设置分享平台顺序和面板中显示的分享平台:
Objective-C
#import<UShareUI/UShareUI.h>
[UMSocialUIManager setPreDefinePlatforms:@[@(UMSocialPlatformType_Sina),@(UMSocialPlatformType_QQ),@(UMSocialPlatformType_WechatSession)]];
[UMSocialUIManager showShareMenuViewInWindowWithPlatformSelectionBlock:^(UMSocialPlatformType platformType,NSDictionary*userInfo){
// 根据获取的platformType确定所选平台进行下一步操作
}];swift
//调用setPreDefinePlatforms的示例
UMSocialUIManager.setPreDefinePlatforms([NSNumber(integerLiteral:UMSocialPlatformType.wechatSession.rawValue),NSNumber(integerLiteral:UMSocialPlatformType.QQ.rawValue),NSNumber(integerLiteral:UMSocialPlatformType.sina.rawValue)])此函数需要在showShareMenuViewInWindowWithPlatformSelectionBlock之前调用
传入的平台必须是合法并且是core模块已经检测到的已经存在的平台,不然会被过滤掉(此条款是上线appStore审核的条件,开发者必须注意)
自定义分享面板样式
配置参数调整控件
分享面板已适配iOS和iPad,用户可以在此基础上微调一些参数来定制特有风格的分享面板。分享面板分有四个主体控件,每个对应的控件都可以独立设置,并且用户可自定义不同风格的控件外观。以下是对应的四个控件:
UMSocialShareTitleView title控件
UMSocialSharePageScrollView 分页控件
UMSocialSharePageControl PageControl控件
UMSocialShareCancelControl CancelControl控件
每个控件有对应相应的配置类,方便用户通过配置参数来调整控件的外观。每个控件的配置类如下:
UMSocialShareTitleView-->UMSocialShareTitleViewConfig
UMSocialSharePageScrollView-->UMSocialSharePageScrollViewConfig
UMSocialSharePageControl-->UMSocialSharePageControlConfig
UMSocialShareCancelControl-->UMSocialShareCancelControlConfigUMSocialShareTitleViewConfig 的参数如下:
BOOL isShow;//是否显示
NSString* shareTitleViewTitleString;//标题的文字
UIFont* shareTitleViewFont;//字体
UIColor* shareTitleViewTitleColor;//文字颜色
UIColor* shareTitleViewBackgroundColor;//背景颜色
CGFloat shareTitleViewPaddingTop;//title的内边距top
CGFloat shareTitleViewPaddingBottom;//title的内边距BottomUMSocialSharePageScrollViewConfig 的参数如下:
CGFloat shareScrollViewPageMaxItemWidth;//每页Items的最大宽度
CGFloat shareScrollViewPageMaxItemHeight;//每页Items的最大高度
UMSocialPlatformItemViewBackgroudType shareScrollViewPageItemStyleType;//每个Item的背景类型
CGFloat shareScrollViewPageMaxRowCountForPortraitAndBottom;//每页显示最大的行(在底部显示手机处于肖像模式)
CGFloat shareScrollViewPageMaxColumnCountForPortraitAndBottom;//每页显示最大的列(在底部显示手机处于肖像模式)
....UMSocialSharePageControlConfig 的参数如下:
BOOL isShow;//是否显示
UIColor* sharePageControlPageIndicatorTintColor;//指示器颜色
UIColor* sharePageControlCurrentPageIndicatorTintColor;//当前的页的颜色
BOOL sharePageControlHidesForSinglePage;//为一页是会隐藏
UIColor* sharePageControlBackgroundColor;//背景色UMSocialShareCancelControlConfig的参数如下:
BOOL isShow;//是否显示
NSString* shareCancelControlText;//相对父view的左边距
UIColor* shareCancelControlTextColor;//文字颜色
UIFont* shareCancelControlTextFont;//文字字体
UIColor* shareCancelControlBackgroundColor;//背景颜色;部分示例代码:
要修改当前分享面板为:分享面板的滑动的区域的背景色为红色,每页的背景色为黄色,去掉毛玻璃效果。
//配置上面需求的参数 //shareScrollView背景色为红色 [UMSocialShareUIConfig shareInstance].sharePageScrollViewConfig.shareScrollViewBackgroundColor =[UIColor redColor]; //每页的背景颜色为黄色 [UMSocialShareUIConfig shareInstance].sharePageScrollViewConfig.shareScrollViewPageBGColor =[UIColor yellowColor]; //去掉毛玻璃效果 [UMSocialShareUIConfig shareInstance].shareContainerConfig.isShareContainerHaveGradient = NO; //调用分享面板 [UMSocialUIManager showShareMenuViewInWindowWithPlatformSelectionBlock:^(UMSocialPlatformType platformType,NSDictionary*userInfo){ // 根据获取的platformType确定所选平台进行下一步操作 }];要修改当前分享面板为:无titleview,面板显示再中间,肖像模式下的2行3列,风景模式2行6列,没有取消控件。
//配置上面需求的参数 [UMSocialShareUIConfig shareInstance].shareTitleViewConfig.isShow = NO; [UMSocialShareUIConfig shareInstance].sharePageGroupViewConfig.sharePageGroupViewPostionType =UMSocialSharePageGroupViewPositionType_Middle; [UMSocialShareUIConfig shareInstance].sharePageScrollViewConfig.shareScrollViewPageMaxRowCountForPortraitAndMid =2; [UMSocialShareUIConfig shareInstance].sharePageScrollViewConfig.shareScrollViewPageMaxColumnCountForPortraitAndMid =3; [UMSocialShareUIConfig shareInstance].sharePageScrollViewConfig.shareScrollViewPageMaxRowCountForLandscapeAndMid =2; [UMSocialShareUIConfig shareInstance].sharePageScrollViewConfig.shareScrollViewPageMaxColumnCountForLandscapeAndMid =6; [UMSocialShareUIConfig shareInstance].shareCancelControlConfig.isShow = NO; //调用分享面板 [UMSocialUIManager showShareMenuViewInWindowWithPlatformSelectionBlock:^(UMSocialPlatformType platformType,NSDictionary*userInfo){ // 根据获取的platformType确定所选平台进行下一步操作 }];
自定义分享面板中的icon与事件
分享面板还可支持加入其他功能的图标,可处理自定义逻辑。如在分享面板后面加一个“copy”功能。(注意每个在分享面板上显示的icon对应一个平台以UMSocialPlatformType类型作为标记)假定“copy”功能需要设置一个UMSocialPlatformType类型为:UMSocialPlatformType_UserDefine_Begin+2示例代码如下:
//加入copy的操作
//@see http://dev.umeng.com/social/ios/进阶文档#6
[UMSocialUIManager addCustomPlatformWithoutFilted:UMSocialPlatformType_UserDefine_Begin+2
withPlatformIcon:[UIImage imageNamed:@"auth_icon"]
withPlatformName:@"copy"];
[UMSocialShareUIConfig shareInstance].sharePageGroupViewConfig.sharePageGroupViewPostionType =UMSocialSharePageGroupViewPositionType_Bottom;
[UMSocialShareUIConfig shareInstance].sharePageScrollViewConfig.shareScrollViewPageItemStyleType =UMSocialPlatformItemViewBackgroudType_None;
[UMSocialUIManager showShareMenuViewInWindowWithPlatformSelectionBlock:^(UMSocialPlatformType platformType,NSDictionary*userInfo){
//在回调里面获得点击的
if(platformType ==UMSocialPlatformType_UserDefine_Begin+2){
NSLog(@"do your operation for copy");
}
else{
[self runShareWithType:platformType];
}
}];用户设置图标时,需要和保持预定于的图标大小一样,以保持样式统一
设置分享面板代理
代理协议如下:
@protocolUMSocialShareMenuViewDelegate<NSObject>
@optional
/**
* 分享面板显示的回调
*/
-(void)UMSocialShareMenuViewDidAppear;
/**
* 分享面板的消失的回调
*/
-(void)UMSocialShareMenuViewDidDisappear;
/**
* 返回分享面板的父窗口,用于嵌入在父窗口上显示
*
* @param defaultSuperView 默认加载的父窗口
*
* @return 返回实际的父窗口
* @note 返回的view应该是全屏的view,方便分享面板来布局。
* @note 如果用户要替换成自己的ParentView,需要保证该view能覆盖到navigationbar和statusbar
* @note 当前分享面板已经是在window上,如果需要切换就重写此协议,如果不需要改变父窗口则不需要重写此协议
*/
-(UIView*)UMSocialParentView:(UIView*)defaultSuperView;
@end可以更改分享面板的父窗口(示例)
/* 上下文 */
// self继承自UIViewController
[UMSocialUIManager setShareMenuViewDelegate:self];
/* 上下文 */
//不需要改变父窗口则不需要重写此协议
-(UIView*)UMSocialParentView:(UIView*)defaultSuperView
{
return defaultSuperView;
}#