I try to log in VK
//MARK: VK func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool { return VKSdk.processOpenURL(url, fromApplication: sourceApplication) } Plist has
<key>LSApplicationQueriesSchemes</key> <array> <string>vkauthorize</string> </array> Request itself
@IBAction func test(sender: AnyObject) { let SCOPE = [VK_PER_FRIENDS, VK_PER_WALL, VK_PER_AUDIO, VK_PER_PHOTOS, VK_PER_NOHTTPS, VK_PER_EMAIL, VK_PER_MESSAGES]; VKSdk.initializeWithAppId("5462514") VKSdk.authorize(SCOPE) } gives the error -canOpenURL: failed for URL: "vkauthorize: // authorize" - error: "(null)"
read what you need to add
extension ViewController: VKSdkDelegate { func vkSdkNeedCaptchaEnter(captchaError: VKError) { } func vkSdkTokenHasExpired(expiredToken: VKAccessToken) { } func vkSdkUserDeniedAccess(authorizationError: VKError) { } func vkSdkShouldPresentViewController(controller: UIViewController) { } func vkSdkReceivedNewToken(newToken: VKAccessToken) { } } In response, I get the error Type 'TSTLogInViewController' does not conform to the protocol 'VKSdkDelegate'
Accordingly, VKSdk.initializeWithDelegate (self, andAppId: "46 *** 65") does not work either.
Is there a solution to these problems?