友盟分享使用

 

一、

//自定义分享界面 增加分享按钮

[UMSocialUIManager addCustomPlatformWithoutFilted:UMSocialPlatformType_UserDefine_Begin+2
withPlatformIcon:[UIImage imageNamed:@"org_myHome"]
withPlatformName:@"个人主页"];

[UMSocialUIManager addCustomPlatformWithoutFilted:UMSocialPlatformType_UserDefine_Begin+3
withPlatformIcon:[UIImage imageNamed:@"org_myCopy"]
withPlatformName:@"复制链接"];

//移除微信收藏
[[UMSocialManager defaultManager] removePlatformProviderWithPlatformType:UMSocialPlatformType_WechatFavorite];

[UMSocialShareUIConfig shareInstance].sharePageGroupViewConfig.sharePageGroupViewPostionType = UMSocialSharePageGroupViewPositionType_Bottom;
[UMSocialShareUIConfig shareInstance].sharePageScrollViewConfig.shareScrollViewPageItemStyleType = UMSocialPlatformItemViewBackgroudType_None;
[UMSocialUIManager showShareMenuViewInWindowWithPlatformSelectionBlock:^(UMSocialPlatformType platformType, NSDictionary *userInfo)

{
//在回调里面获得点击的
if (platformType == UMSocialPlatformType_UserDefine_Begin+2) {//分享个人主页
dispatch_async(dispatch_get_main_queue(), ^{

  if([AppDelegate APP].userInfo.keyKeyId == self.ycDetailModel.orAuthorId)
  {
    [MBProgressHUD showError:@"不能转发自己的作品!"];
  }
  [self shareViewShow];
});
}
else if(platformType == UMSocialPlatformType_UserDefine_Begin+3)//复制
{
  UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];

  pasteboard.string = self.ycDetailModel.ycUrl;

  [MBProgressHUD showSuccess:@"复制链接成功!"];
}
else{
  [self shareWebPageToPlatformType:platformType];
}

}];

 

二、清空自定义分享按钮

[UMSocialUIManager  removeAllCustomPlatformWithoutFilted];

posted @ 2017-01-23 17:27  锦夏ing  阅读(371)  评论(0编辑  收藏  举报