|
/

iOS 平台,使用Facebook图文分享,分享弹窗只显示图片,但无法显示文本

X小西西
发布于 4 年前
428
移动统计 U-App
API调用

-(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);

}

}];

}

报错原因:************Share fail with error Error Domain=UMSocialPlatformErrorDomain Code=2006 "(null)" UserInfo={\^^message=Share data type is illegal}*********

4个回答
 
4 年前
来自上海

目前友盟不支持海外版的三方sdk,如有需要直接使用对应的原生sdk

 
4 年前

目前,facebook平台支持的可分享内容是:图片 链接 视频

Loading ...
登录社区,分享你的经验