Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

Ditza's avatar
Ditza
Explorer | Level 3
5 years ago
Solved

authorizeFromControllerV2 error when authorizing

I am trying to switch from a long-life token to a short one.
I am using SwiftyDropbox SDK version 7.0.1

I am following the instructions on the readme tutorial on GitHub: 

https://github.com/dropbox/SwiftyDropbox/tree/7.0.1 

In the "Begin authorization flow" section,
I change the function to:

authorizeFromControllerV2

Now when I press on "Allow" in dropbox permission pop I am getting an error:

"Error Authorizining App. An error occurred authorizing your app. Please try again"

I saw this post and added SceneDelegate file to my project and added this code inside:

 

 

    func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
        if let url = URLContexts.first?.url {
            
            let oauthCompletion: DropboxOAuthCompletion = {
              if let authResult = $0 {
                  switch authResult {
                  case .success:
                      print("Success! User is logged into DropboxClientsManager.")
                  case .cancel:
                      print("Authorization flow was manually canceled by user!")
                  case .error(_, let description):
                      print("Error: \(String(describing: description))")
                  }
              }
            }
            DropboxClientsManager.handleRedirectURL(url, completion: oauthCompletion)
            
        }
    }

 

 

It didn't help. 
When I click on cancel instead of Allow I am getting back to the AppDelegate file.

 

 

  • Yes, scoped apps can still use the old authorizeFromController method. It will just use the default scopes set for the app in the App Console.

3 Replies

Replies have been turned off for this discussion
  • Ditza's avatar
    Ditza
    Explorer | Level 3
    5 years ago

    Sorry, I missed this step,
    If I do so I still can use the old version of the code?

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

    Yes, scoped apps can still use the old authorizeFromController method. It will just use the default scopes set for the app in the App Console.

About Dropbox API Support & Feedback

Node avatar for 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!