A
A
artem-Kolyadin2018-05-10 02:19:16
iOS
artem-Kolyadin, 2018-05-10 02:19:16

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
5af441474ae83208469981.png
Delegate methods
5af441104bffc975649217.png
Console
5af4414f73c3c732989971.png
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 answer(s)
D
Dmitry Donkovtsev, 2018-05-10
@artem-Kolyadin

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 question

Ask a Question

731 491 924 answers to any question