I'm trying to screw VKSdk to the application. When I try to call VKSdk.authorize (scope), I get an error:
-canOpenURL: failed for URL: "vkauthorize://authorize" - error: "Не удалось завершить операцию. (OSStatus, ошибка -10814)" I run the application in the emulator (Swift 3, iOS 10.0)
Performed actions:
- Created standalone-application Vkontakte.
- I set up URL-types applications in info.plist according to the Twitter manual. According to the url of Safari, vkXXXXXXX: // the application opens.
- Configured in the info.plist application
<key>LSApplicationQueriesSchemes</key> <array> <string>vk</string> <string>vk-share</string> <string>vkauthorize</string> </array> - Added method to AppDelegate:
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: "XXXXXXXX") 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 } - I run the application in the emulator. I switch to Safari, enter vkXXXXXXXX: // in the address bar. A dialog opens asking you to open the application. After confirmation, the code presented above is executed and at the time of calling VKSdk.authorize (scope) I get the error voiced at the beginning.