虚心使人进步

虚心学习,天天向上......
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

友盟分享的坑

Posted on 2018-01-21 15:40  Showker  阅读(267)  评论(0)    收藏  举报

1、签名一致

2、ios设置Info里shemas

3、新碰到的问题

先分享链接的,再分享纯图片就不行

反过来也一样

不知道是什么原因

===

终于搞定,分享链接和分享图片,2步接着操作导致图片不能分享崩溃的问题了。

 

要定义[UMSocialData defaultData] +initWithIdentifier不同的id

//分享链接的

 UMSocialData *socialData =[[UMSocialData defaultData] initWithIdentifier:@"identifierLink"];// [UMSocialData defaultData initWithIdentifier:@"A Book Named BILI"];

 

//分享图片的

    UMSocialData *socialData =[[UMSocialData defaultData] initWithIdentifier:@"identifierImg"];// [UMSocialData defaultData initWithIdentifier:@"A Book Named BILI"];

 

这样,不管是先分享链接,还是先分享图片。都正常了。

========

参考

 

- (IBAction)shareAction:(UIBarButtonItem *)sender
{
if (!_shareInfo)
{
return;
}
UMSocialData *socialData = [UMSocialData defaultData];
socialData.extConfig.qqData.title = _shareInfo.title;
socialData.extConfig.qqData.url =_shareInfo.url;

socialData.extConfig.qzoneData.title = _shareInfo.title;
socialData.extConfig.qzoneData.url = _shareInfo.url;


socialData.extConfig.wechatSessionData.title = _shareInfo.title;
socialData.extConfig.wechatSessionData.url = _shareInfo.url;


socialData.extConfig.wechatTimelineData.title = _shareInfo.title;
socialData.extConfig.wechatTimelineData.url = _shareInfo.url;

//网络图片url的分享,如果有url图片,则本地图片shareImage无效了,可以设置nil;
[[UMSocialData defaultData].urlResource setResourceType:UMSocialUrlResourceTypeImage url:_shareInfo.ico];

[UMSocialSnsService presentSnsIconSheetView:self
appKey:nil
shareText:_shareInfo.content
shareImage:nil
shareToSnsNames:[NSArray arrayWithObjects:UMShareToSina,UMShareToTencent,UMShareToEmail,UMShareToQQ,UMShareToQzone,UMShareToWechatSession,UMShareToWechatTimeline,UMShareToSms,nil]
delegate:nil];

}