Skip to content

Commit 7308e33

Browse files
committed
Umeng 的 urlResource 不能置空
1 parent e2d68a7 commit 7308e33

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Coding_iOS/Views/CodingShareView.m

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -417,14 +417,10 @@ -(void)didSelectSocialPlatform:(NSString *)platformName withSocialData:(UMSocial
417417
//设置分享内容,和回调对象
418418
{
419419
socialData.shareText = [self p_shareText];
420+
socialData.shareImage = [UIImage imageNamed:@"logo_about"];
420421
NSString *imageUrl = [self p_imageUrl];
421-
if (imageUrl.length > 0) {
422-
socialData.urlResource = [[UMSocialUrlResource alloc] initWithSnsResourceType:UMSocialUrlResourceTypeImage url:imageUrl];
423-
socialData.shareImage = nil;
424-
}else{
425-
socialData.urlResource = nil;
426-
socialData.shareImage = [UIImage imageNamed:@"logo_about"];
427-
}
422+
socialData.urlResource.url = imageUrl;
423+
socialData.urlResource.resourceType = imageUrl.length > 0? UMSocialUrlResourceTypeImage: UMSocialUrlResourceTypeDefault;
428424
}
429425
if ([platformName isEqualToString:@"wxsession"]) {
430426
UMSocialWechatSessionData *wechatSessionData = [UMSocialWechatSessionData new];

0 commit comments

Comments
 (0)