点击微信登录的时候出现无法获取accessToken
的现象,其他如QQ
、微博
都可以正常登录使用。另外QQ
、微博
和微信
分享都可以正常使用。
望各位早日帮我解决或者分析一下。谢谢
//微信登录之后的回调
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
BOOL result = [UMSocialSnsService handleOpenURL:url wxApiDelegate:nil];
if (result == FALSE) {
//其他操作
}
return result;
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
[UMSocialSnsService applicationDidBecomeActive];
}
//登录代码
#pragma mark -
- (IBAction)forgetClick3:(id)sender{
//此处调用授权的方法,你可以把下面的platformName 替换成 UMShareToSina,UMShareToTencent等
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);
}
});
}
回调之后弹出‘服务器繁忙,授权失败’,并且控制台输出以下信息:
[21:15:26.290( 2823)] - UMSocial: createSocialAction uid is 6076bfab5e98cf377649ede5f8b95e
[21:15:26.296( 2823)] - UMSocial: You must set accessToken!
[21:15:26.298( 2823)] - UMSocial: makeRequestWithPath is /share/token/54547f14fd98c53c5e00001f/, parameters is {
ak = 54547f14fd98c53c5e00001f;
"app_id" = wxa922a6994c4ed428;
"app_secret" = afde0ccf8bfc94fecea5ff987e1ff28a;
de = "iPhone5,4";
dt = 1456319726292;
ek = 63c4eacd667596610fe9a3038edddddd;
en = WiFi;
"expires_in" = 0;
mac = "02:00:00:00:00:00";
openudid = 3632d3ac95662f6d43e671c03cfeeefb6ddddddd;
os = iOS;
pcv = "2.0";
sdkv = "5.0";
to = wxsession;
tp = 0;
uid = 3076bfab5e98cf333649ede5fddddd;
usid = "";
}
2016-02-24 21:15:26.458 bangwa[777:203689] __39-[NewLoginViewController forgetClick2:]_block_invoke [Line 611] response is {
data = {
wxsession = {
usid = "";
};
};
responseCode = 200;
responseType = 9;
viewControllerType = 7;
}
Hello, adakah masalah ini telah diselesaikan? Saya menyepadukannya sebelum ini, tetapi hari ini saya tiba-tiba menemui masalah yang sama seperti anda.