vk-ios-sdk icon indicating copy to clipboard operation
vk-ios-sdk copied to clipboard

-canOpenURL: failed for URL: "vkauthorize://authorize"

Open cdjun100ying2 opened this issue 7 years ago • 3 comments
trafficstars

login with not install vk app will print this message "-canOpenURL: failed for URL: "vkauthorize://authorize" - error: "(null)"" if install vk app it will ok. i use this code for login: NSArray *SCOPE = @[@"email"]; [VKSdk authorize:SCOPE];

cdjun100ying2 avatar Feb 02 '18 06:02 cdjun100ying2

I have the same issue. More details:

canOpenURL: failed for URL: "vkauthorize://authorize" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
[Warning] Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior (<SFSafariViewController: 0x7ff91d029800>)

romul avatar Feb 11 '18 16:02 romul

I've found a solution.. In case when user has no vk app installed, you need implement vkSdkShouldPresent of VKSdkUIDelegate in your login view controller:

func vkSdkShouldPresent(_ controller: UIViewController!) {
        if (self.presentedViewController != nil) {
            self.dismiss(animated: true, completion: {
                print("hide current modal controller if presents")
                self.present(controller, animated: true, completion: {
                    print("SFSafariViewController opened to login through a browser")
                })
            })
        } else {
            self.present(controller, animated: true, completion: {
                print("SFSafariViewController opened to login through a browser")
            })
        }
    }

romul avatar Feb 12 '18 11:02 romul

10814 это ошибка kLSApplicationNotFoundErr https://www.osstatus.com/search/results?platform=all&framework=all&search=10814

NikKovIos avatar Aug 26 '21 18:08 NikKovIos