In my app, I have a Facebook login in my first view controller which redirects to my next view controller after a successful login that has a LinkedIn Login option.
However, after the LinkedIn Login button is pressed, I receive this error.
2016-10-17 23:00:42.588 Frieyo[86134:1636422] -canOpenURL: failed for URL: "linkedin://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
2016-10-17 23:00:42.593 Frieyo[86134:1636422] Warning: Attempt to present <UINavigationController: 0x7f9fa409ba00> on <Frieyo.TutorialViewController: 0x7f9fa2c04430> whose view is not in the window hierarchy!
I know it's not a problem with opening the LinkedIn URL because my App Delegate is handling those URL's correctly AND when I set the LinkedIn view controller as my initial view controller the login WORKS!
Apparently these answers: iOS: Warning "attempt to present ViewController whose view is not in the window hierarchy" and whose view is not in the window hierarchy indicate that I should put this method in my viewDidAppear method; however, that is not relevant because I am redirecting to another view after a successful login.
The problem (I assume) lies within the view stack. Here's is how I'm am transitioning from the first view controller to the LinkedIn VC.
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
let nextViewController = storyBoard.instantiateViewController(withIdentifier: "VerifyLinkedInViewController") as! VerifyLinkedInViewController
self.present(nextViewController, animated:true, completion:nil)
How exactly do I re-write to avoid -"whose view is not in the window hierarchy!" ?