Closed llx827410028 closed 5 months ago
Version: VKSDK 1.6.4 Integrated function: VK login Login result: "Error Domain=VKSdkErrorDomain Code=-101 \\"User authorization failed: invalid access_token (4).\\" UserInfo={VkErrorDescriptionKey=<VKError: 0x306f3e7d0; API error {code: 5; message: User authorization failed: invalid access_token (4).;}>, NSLocalizedDescription=User authorization failed: invalid access_token (4)》
---------------》》》》》》》------------------
NSArray *SCOPE = @[VK_PER_FRIENDS, VK_PER_WALL, VK_PER_PHOTOS, VK_PER_NOHTTPS, VK_PER_EMAIL, VK_PER_DOCS]; [[VKSdk instance]registerDelegate:self]; [[VKSdk instance]setUiDelegate:self];
[self startJumpOtherAppUnusualListenerWithFailBlock:failBlock];
[VKSdk wakeUpSession:SCOPE completeBlock:^(VKAuthorizationState state, NSError *error) {
if (error) {
Step two:get info
if (result.token) { NSDictionary *dic = @{ @"access_token":[MJSDK_Tool isEntiyWithKey:result.token.accessToken], @"user_id":[MJSDK_Tool isEntiyWithKey:result.token.userId], }; if (self.o_getVKInfo_handleSucBlock) { self.o_getVKInfo_handleSucBlock([MJSDK_Tool getJsonStrWithDic:dic]); } } else { if (self.o_getVKInfo_handleFailBlock) { self.o_getVKInfo_handleFailBlock(EMJSDK_VK_get_userinfo_Fail,[NSString stringWithFormat:@"error:%@",result.error]); } }
[VKSdk forceLogout]; }
Hi @llx827410028. It seems that your issue is related to another product - https://github.com/VKCOM/vk-ios-sdk.
More details about VK ID SDK you can see here.
dgsdg5s4dgs5g4sdgドっぱくラバニラサダウのブはとてもおいしそうなりんかマカョ♂
Version: VKSDK 1.6.4 Integrated function: VK login Login result: "Error Domain=VKSdkErrorDomain Code=-101 \\"User authorization failed: invalid access_token (4).\\" UserInfo={VkErrorDescriptionKey=<VKError: 0x306f3e7d0; API error {code: 5; message: User authorization failed: invalid access_token (4).;}>, NSLocalizedDescription=User authorization failed: invalid access_token (4)》
---------------》》》》》》》------------------
The following is the code, please help me see where the problem is Step one: wakeup
NSArray *SCOPE = @[VK_PER_FRIENDS, VK_PER_WALL, VK_PER_PHOTOS, VK_PER_NOHTTPS, VK_PER_EMAIL, VK_PER_DOCS]; [[VKSdk instance]registerDelegate:self]; [[VKSdk instance]setUiDelegate:self];
[self startJumpOtherAppUnusualListenerWithFailBlock:failBlock];
[VKSdk wakeUpSession:SCOPE completeBlock:^(VKAuthorizationState state, NSError *error) {
if (error) {
if (failBlock) { failBlock(EMJSDK_VK_get_userinfo_Fail,[NSString stringWithFormat:@"获取vk用户信息失败。error:%@",error]); } }else{ [VKSdk authorize:SCOPE]; } }];
Step two:get info
if (result.token) { NSDictionary *dic = @{ @"access_token":[MJSDK_Tool isEntiyWithKey:result.token.accessToken], @"user_id":[MJSDK_Tool isEntiyWithKey:result.token.userId], }; if (self.o_getVKInfo_handleSucBlock) { self.o_getVKInfo_handleSucBlock([MJSDK_Tool getJsonStrWithDic:dic]); } } else { if (self.o_getVKInfo_handleFailBlock) { self.o_getVKInfo_handleFailBlock(EMJSDK_VK_get_userinfo_Fail,[NSString stringWithFormat:@"error:%@",result.error]); } }
[VKSdk forceLogout]; }
[VKSdk forceLogout]; }