Answer the question
In order to leave comments, you need to log in
How to fix error when calling VKSdk.authorize()?
I'm trying to attach to the VKSdk application. When I try to call VKSdk.authorize(scope) I get an error:
-canOpenURL: failed for URL: "vkauthorize://authorize" - error: "Не удалось завершить операцию. (OSStatus, ошибка -10814)"
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
VKSdk.processOpen(url, fromApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String!)
let sdkInstance = VKSdk.initialize(withAppId: "VK_APP_ID")
sdkInstance!.register(self)
sdkInstance!.uiDelegate = self
let scope = ["friends", "email"]
VKSdk.wakeUpSession(scope, complete: {(state: VKAuthorizationState, error: Error?) -> Void in
if state == .authorized {
NSLog("authorized")
} else {
VKSdk.authorize(scope)
}
return
})
return true
}
Answer the question
In order to leave comments, you need to log in
Well, they googled what a mistake, why run here? -> https://www.osstatus.com
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question