美文网首页iOS Developer
友盟微信授权获取微信openid 头像 微信名

友盟微信授权获取微信openid 头像 微信名

作者: 简单的逗号 | 来源:发表于2017-06-22 16:03 被阅读83次

[[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");

}

}

}];

相关文章

网友评论

    本文标题:友盟微信授权获取微信openid 头像 微信名

    本文链接:https://www.haomeiwen.com/subject/wayfcxtx.html