cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right 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: 

SwiftyDropbox is not production-ready

SwiftyDropbox is not production-ready

Sergey S.10
New member | Level 1

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?

9 Replies 9

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

Quick follow up here on #3, this is available as of SwiftyDropbox 3.1.0 as getTemporaryLink.

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

Thanks for catching that! We're looking into it.

Greg-DB
Dropbox Staff

The official Objective-C SDK for API v2 has been released here:

https://github.com/dropbox/dropbox-sdk-obj-c

Greg-DB
Dropbox 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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Sergey S.10 New member | Level 1
What do Dropbox user levels mean?