You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

NeilHowarth's avatar
NeilHowarth
Helpful | Level 6
6 years ago

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 ...
  • NeilHowarth's avatar
    NeilHowarth
    6 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? 


     

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,882 PostsLatest Activity: 7 hours ago
325 Following

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 or Facebook.

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!