Answer the question
In order to leave comments, you need to log in
How to do authorization through VK iOS SDK?
Good day! Please tell me, the situation is as follows:
There is a controller for authorization in the application via VK.
By pressing a button on the controller, the authorization method is called and the transition to the mob takes place. VK app to request permission. However, after pressing the "allow" button and returning to my application, the vkSdkShouldPresent method is called and not func vkSdkAccessAuthorizationFinished, which I need to get a token and further work with the VK API
. And I would also like to know how to solve the error (indicated in the console), as far as I understand somehow connected with the fact that when you go to the mob. application to request permission is my controller removed or something like that?
Thanks in advance!
Button for authorization
Delegate methods
Console
By the way, if you still implement VkShouldPresent, then a safari window pops up which, when you click the "allow" button, does not return me to the application, unlike trying to request permission in the VK app itself.
Answer the question
In order to leave comments, you need to log in
1) Move sdkInstance to the shared ViewController variables (under VK_APP_ID)
2) Remove the call to the initialize method from buttonLoginVKPressed and it is likely that the call to the authorize method should be rewritten to the variable that you initialize earlier.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question