[[UMSocialManagerdefaultManager]getUserInfoWithPlatform:UMSocialPlatformType_WechatSessioncurrentViewController:selfcompletion:^(idresult,NSError*error) {
NSString*message;
if(error) {
message =@"授权失败";
UMSocialLogInfo(@"Get info fail with error %@",error);
}else{
if([resultisKindOfClass:[UMSocialUserInfoResponseclass]]) {
UMSocialUserInfoResponse* resp = result;
resp.openid;//openid
resp.name;//微信名
resp.iconurl;//头像url
}else{
message =@"授权失败";
UMSocialLogInfo(@"Get info fail with unknow error");
}
}
}];
网友评论