iOS Developer

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

2017-06-22  本文已影响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");

}

}

}];

上一篇 下一篇

猜你喜欢

热点阅读