We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.

Forum Discussion

Sergey S.10's avatar
Sergey S.10
New member | Level 1
9 years ago

SwiftyDropbox is not production-ready

I need "time taken", "video duration" metadata values for user videos. It's not supported in iOS SDK v1 (Dropbox-iOS-SDK), so I decided to use SDK v2 (SwiftyDropbox).

1. It's impossible to use SwiftyDropbox from obj-c code (because classes don't inherit NSObject and use some swift-only features). So that I have to implement some swift wrapper around some SwiftyDropbox methods to make them available from obj-c classes.

2. Done. But when a user click Cancel at "Link to Dropbox" controller, I can't catch this event. "Open URL" method in app delegate is not called in this case. Successful flow works just perfect (URL schemes, query schemes, bla-bla — all this stuff is set up correctly). Cancel flow doesn't work. Bug?

3. Nevermind. Now I need method "get streamable url" for some file. Just direct link to a user file. This method exists in SDK v1, it exists in other SDKs, but there is no such method in SDK v2. Why? What should I do?

In other words, some features are implemented only in v1, another features are implemented only in v2. Is it really too complex to cover at least all methods from v1 before you release v2? Your swift code and architecture is good enough, and it allows to add missing methods mentioned above with two codelines. What is your roadmap for now? Top priority feature for v2 should be "Cover all v1 methods", because we developers already use v1 features. And SDK is created for us, developers, isn't it?

  • Sergey S.10's avatar
    Sergey S.10
    New member | Level 1

    In addition: after upgrade from v1 to v2 SDK my file permission Dropbox app becomes broken. I have to create the new one, with full access. Users will ask me: hey, you asked only for access to my videos before, why you ask permissions for all my files now? If you need only my videos? 

    What should I answer to them?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    1. Thanks for the feedback! We're hoping to address this better on our side in the future, but I don't have a timeline to offer right now.

    2. That sounds like a bug. We're looking into it.

    3. This is also planned, but likewise I don't have an ETA to offer.

    We really appreciate the feedback. I don't have a more specific roadmap to offer, but functional parity between v1 and v2 is an important goal for the team.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Also, unfortunately, API v2 doesn't support the file type permission, so you'll need to use a different one, as you found. I'll send this along as feedback as well.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    For #2, as of SwiftyDropbox 3.2.0, you can now catch a canceled authorization flow in the result from handleRedirectURL as the "Cancel" case, such as:

     if let authResult = Dropbox.handleRedirectURL(url) {
    switch authResult {
    case .Success(let token):
    print("Success! User is logged into Dropbox with token: \(token)")
    case .Cancel:
    print("Authorization flow was manually canceled by user.")
    case .Error(let error, let description):
    print("Error \(error): \(description)")
    }
    }
  • Sergey S.10's avatar
    Sergey S.10
    New member | Level 1

    Thanks for the fix for #3.

    As for #2, it now works for in-app authentication, but it still don't work for authentication via official Dropbox app. If the official Dropbox app is installed, when I try to connect Dropbox account and follow different cancel flows (tap Cancel button in Dropbox app or just launch my app from multitasking menu), cancel callback isn't called. Expected behavior:

    • Dropbox SDK handles the case when a user tap Cancel during connecting via Dropbox app.
    • Dropbox SDK would have a method that a developer can call in "applicationDidBecomeActive" method, so that Dropbox SDK can handle this case and call Cancel callback correctly.
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Another quick update, the cancel case should now work when the authorization flow is handled via the official Dropbox app as well, using the latest version of SwiftyDropbox.

About Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,875 PostsLatest Activity: 2 years ago
323 Following

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!