[[UMSocialControllerService defaultControllerService] setShareText:@"分享内嵌文字" shareImage:[UIImage imageNamed:@"icon"] socialUIDelegate:self]; //设置分享内容和回调对象
[UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToSina].snsClickHandler(self,[UMSocialControllerService defaultControllerService],YES);
之前是这样写的:(不对的哦)
UIViewController *viewcon = GNAppDelegate.rootNavigationController;
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[keySharedStr] content:titleStr image:shareImage location:nil urlResource:nil presentedController:viewcon completion:^(UMSocialResponseEntity *response){
if (response.responseCode == UMSResponseCodeSuccess) {
NSLog(@"分享成功!");
}
}];
本文介绍如何使用UMSocial分享组件进行内容分享,包括设置分享的文字、图片及配置回调对象等关键步骤。通过示例代码展示了正确的使用方式,并指出了常见的错误用法。
6012

被折叠的 条评论
为什么被折叠?



