第三方登录,微信登录集成错误原因(其中一条)
UMSocialSnsPlatform *snsPlatform = [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToWechatSession];
snsPlatform.loginClickHandler(self,[UMSocialControllerService defaultControllerService],YES,^(UMSocialResponseEntity *response){
if (response.responseCode == UMSResponseCodeSuccess) {
UMSocialAccountEntity *snsAccount = [[UMSocialAccountManager socialAccountDictionary]valueForKey:UMShareToWechatSession];
NSLog(@"username is %@, uid is %@, token is %@ url is %@",snsAccount.userName,snsAccount.usid,snsAccount.accessToken,snsAccount.iconURL);
}
});
然后,点登录按钮时就崩溃,出错信息如下:
+[WXApi sendAuthReq:viewController:delegate:]: unrecognized selector sent to class 0x1004dd558
libc++abi.dylib: terminate_handler unexpectedly threw an exception
QQ登录和微博登录都没问题。SDK版本是4.2.3
最后的解决方法:友盟的sdk和share的sdk冲突,项目里面删除share的sdk就可以了