cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

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

ShinehahGnolaum
Helpful | Level 7

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 2

ShinehahGnolaum
Helpful | Level 7

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
Dropbox Staff

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.

Need more support?