友盟分享成功回调方法不执行[-(void)didFinishGetUMSocialDataInViewController:(UMSocialResponseEntity *)response;]昨天百度弄了一天也没整出来
今天突然发现根本就不用走这个方法也可以判断出分享是否成功,看下面:
就是直接在点击分享图标分享的时候判断
//朋友圈分享
if ([shareString isEqualToString:@"weixin_circle"])
{
[UMSocialData defaultData].extConfig.title = @"***的分享";
[UMSocialData defaultData].extConfig.wechatTimelineData.url = @"分享的链接";
UMSocialUrlResource *urlResource = [[UMSocialUrlResource alloc] initWithSnsResourceType:UMSocialUrlResourceTypeImage url:@"share_imageUrl"];
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatTimeline] content:@"share_content" image:nil location:nil urlResource:urlResource presentedController:self completion:^(UMSocialResponseEntity *shareResponse)
{
/*
UMSResponseCodeSuccess = 200, //成功
UMSREsponseCodeTokenInvalid = 400, //授权用户token错误
UMSResponseCodeBaned = 505, //用户被封禁
UMSResponseCodeFaild = 510, //发送失败(由于内容不符合要求或者其他原因)
UMSResponseCodeArgumentsError = 522, //参数错误,提供的参数不符合要求
UMSResponseCodeEmptyContent = 5007, //发送内容为空
UMSResponseCodeShareRepeated = 5016, //分享内容重复
UMSResponseCodeGetNoUidFromOauth = 5020, //授权之后没有得到用户uid
UMSResponseCodeAccessTokenExpired = 5027, //token过期
UMSResponseCodeNetworkError = 5050, //网络错误
UMSResponseCodeGetProfileFailed = 5051, //获取账户失败
UMSResponseCodeCancel = 5052, //用户取消授权
UMSResponseCodeNotLogin = 5053, //用户没有登录
UMSResponseCodeNoApiAuthority = 100031 //QQ空间应用没有在QQ互联平台上申请上传图片到相册的权限
*/
if (shareResponse.responseCode == UMSResponseCodeSuccess)
{
NSLog(@"分享成功!");
//需要的数据在shareResponse中都有
//平台名
NSString *platformName = [[shareResponse.data allKeys] objectAtIndex:0];
//继续写你的代码。。。。。。。。。。。。。。。。。
}else{
NSLog(@"%d",response.responseCode);
}
}];
iOS友盟分享成功不走回调
最新推荐文章于 2021-01-30 18:11:39 发布