We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
NeilHowarth
7 years agoHelpful | Level 6
SwiftyDropBox SwiftyDropbox.MobileSafariViewController not in the window hierarchy
Hi, I have developed an application in Xcode (macOS) for iOS and I have integrated the SwiftyDropBox API. I have followed all the instructions in the README, but when I make a call to open a link to ...
- 7 years ago
Hi,
I think you're right but not sure what I was doing wrong, the call is in my viewcontroller, however I tried
DropboxClientsManager.authorizeFromController(UIApplication.shared, controller: UIApplication.shared.keyWindow!.rootViewController!, openURL: { (url: URL) -> Void in UIApplication.shared.open(url, options: [:], completionHandler: nil) })
i.e. using rootViewController instead of self and it worked.
Thanks for your response
Neil
Greg-DB wrote:When/where are you calling authorizeFromController?
This error message generally indicates that the authorization window can't be displayed because it relies on yourViewController, but theViewController wasn't in the window hierarchy (yet?) at time of the call. Perhaps your ViewController wasn't presented (or was already dimissed) at the time?
Greg-DB
Dropbox Community Moderator
7 years agoWhen/where are you calling authorizeFromController?
This error message generally indicates that the authorization window can't be displayed because it relies on yourViewController, but theViewController wasn't in the window hierarchy (yet?) at time of the call. Perhaps your ViewController wasn't presented (or was already dimissed) at the time?
- NeilHowarth7 years agoHelpful | Level 6
Hi,
I think you're right but not sure what I was doing wrong, the call is in my viewcontroller, however I tried
DropboxClientsManager.authorizeFromController(UIApplication.shared, controller: UIApplication.shared.keyWindow!.rootViewController!, openURL: { (url: URL) -> Void in UIApplication.shared.open(url, options: [:], completionHandler: nil) })
i.e. using rootViewController instead of self and it worked.
Thanks for your response
Neil
Greg-DB wrote:When/where are you calling authorizeFromController?
This error message generally indicates that the authorization window can't be displayed because it relies on yourViewController, but theViewController wasn't in the window hierarchy (yet?) at time of the call. Perhaps your ViewController wasn't presented (or was already dimissed) at the time?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!