Open cdjun100ying2 opened 6 years ago
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>)
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")
})
}
}
10814 это ошибка kLSApplicationNotFoundErr https://www.osstatus.com/search/results?platform=all&framework=all&search=10814
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];