We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

ShinehahGnolaum's avatar
ShinehahGnolaum
Helpful | Level 7
7 years ago

openURL closure of DropboxClientsManager.authorizeFromController(_:controller:openURL:) not executed

I have this code:

    DropboxClientsManager.authorizeFromController(UIApplication.shared, controller: self) {
        
        (url: URL) in
        
        print("**!!!**")

        UIApplication.shared.open(url, options: [:]) {
            
            success in
            
            print("**!!!")
            
            self.navigationItem.prompt = "**!!!"

        }

        print("*****")
        
        self.navigationItem.prompt = "*****"

    }

I don't think the closure is running at all. It is the openURL argument. None of the print statements show. None of the changes to navigationItem.prompt show. When I comment the intire UIApplication.shared.open(url:options:completionHandler:) statement, there are no changes.

Does anyone know what the matter is?

Any help will be appreciated.

 

2 Replies

  • I think the last reply of this post answers the question: #M11267 .

    Is it correct that if the Dropbox app is not installed then openURL is not called?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago

    That code will only get run once the user returns to your app after authorizing it in the app authorization flow. Are you successfully completing the app authorization flow?

    First, please make sure you've implemented all of the pieces as documented here:

    https://github.com/dropbox/SwiftyDropbox#handling-the-authorization-flow

    Note that whether the flow is handled by the browser or by the official Dropbox app, the flow works the same way; the user is redirected back to your app, and that code block should be run.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 6 hours ago
410 Following

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 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!