cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in hearing how one of our Community members uses Dropbox for sailing trips? Read all about it 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: 

iOS SwiftyDropbox - login problem

iOS SwiftyDropbox - login problem

Lukasz_Nestor
Explorer | Level 4

Hello,

 

I'm trying to integrate SwiftyDropbox (newest version 7.0.1 built as xcframework, running on iPad/iPhone with iOS 14.6) into my application ExplainEverything (current store version uses old version of Dropbox SDK - ObjectiveDropboxOfficial 3.7.0 and it works without any problems).

I have problem with the authorizing with SwiftyDropbox. I'm using the following code to login:
```

            let scopeRequest = ScopeRequest(scopeType: .user,

                                            scopes: ["files.metadata.read", "files.content.read", "files.content.write", "account_info.read"],

                                            includeGrantedScopes: false)

 

            DropboxClientsManager.authorizeFromControllerV2(

                UIApplication.shared,

                controller: controller,

                loadingStatusDelegate: nil,

                openURL: { url in UIApplication.shared.open(url, options: [:], completionHandler: nil) },

                scopeRequest: scopeRequest

            )
```
For logout I use:
```

        DropboxClientsManager.unlinkClients()
```

It works fine for the first time. The authorizing is successfull and all another requests works also properly, e.g. listing folders, download/upload file. But if I logout and then try to login again, the SDK returns error - `SwiftyDropbox.OAuth2Error error 11. The operation couldn't be completed.  `. The next try is successful and the next next try returns error. So it works like: success, failure, sucess, failure, ...

The error occurs if I have Dropbox application installed on my device (official app from App Store). So the login process uses this app.

It doesn't occur without this application being installed (the SDK uses internally SFSafariViewController then). 

Can You give me some advice what I'm doing wrong or is this some kind of known issue?
Thanks, Łukasz

3 Replies 3

Greg-DB
Dropbox Staff

Thanks for the detailed report! We'll look into it.

Lukasz_Nestor
Explorer | Level 4

Update:

The problem occurs if I make the mentioned steps quickly: login, logout, login, ...

It works properly if I wait few seconds (5-10s) before trying to login next time. 

Also the problem doesn't occur on every device, e.g. on iPad Pro 9,7'' (2016) or iPad Air (2013) it doesn't occur. But it occurs for example on the following devices: iPad Pro 12.9'' 4th gen (2020), iPad Pro 10.5'' (2017), iPhone 7 plus, iPhone 6 plus. (all mentioned devices with newest iOS 14.6)

Greg-DB
Dropbox Staff

Thanks for following up with the additional information!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Lukasz_Nestor Explorer | Level 4
What do Dropbox user levels mean?