cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 

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

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

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?

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

Dropboxer
Dropboxer

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.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?