cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Re: Need Alamofire 4.0.0 for swift 3.0

Need Alamofire 4.0.0 for swift 3.0

Mark L.45
Collaborator | Level 8

Want to use swiftyDropbox with Swift 3.0 / IOS 10.0

Followed the install instructions, but it downloads the wrong version of Alamofire I suspect.

I think I need 4.0.0 which I can add to a swift 3.0 independently, compile and run. Version 3.3.X that the loads when you do the podfile for SwifyDropbox install won't even compile, gives me dozens of errors.

How to change the podfile to select a more recent copy of Alamofile? 

16 Replies 16

Stewart L.1
Explorer | Level 3

Link to documentation in post is broken. 

Stephen C.14
Dropbox Staff

@Stewart L.: Thanks! It's fixed now 🙂

Mark L.45
Collaborator | Level 8

Would like to say this was painless and worked... but it wasn't and although I now having got it to compile and work once, just once I find myself with the report.

precondition failed: A Dropbox client is already authorized: file /Users/localuser/Dropbox/SwiftCode/DBDrop/Carthage/Checkouts/SwiftyDropbox/Source/SwiftyDropbox/SwiftyDropbox_iOS/iOS/OAuthMobile.swift, line 13

This despite the fact that I delete the app and re-install it again and again. I am sorry I must be your worst nightmare. I try and go back and read the docs, hopefully I missed something.

Mark L.45
Collaborator | Level 8

OK, managed to find my way around it, commented out line...

DropboxClientsManager.authorizeFromController(UIApplication.shared,

                                                          controller: self,

                                                          openURL: { (url: URL) -> Void in

                                                            UIApplication.shared.openURL(url)

            })

Which of course I am going to need for future clients....  now I find this

DropboxClientsManager.authorizedClient?.auth.client.accessToken.isEmpty

in the API which returns true and false.  On a client I have never authenticated in fact it returns "nil", on an authenticated client it returns "false"... can I rely on this?

 

Stephen C.14
Dropbox Staff

@Mark L.: No worries, we're constantly trying to improve the SDK, so it's really helpful hearing your feedback.

As far as the issue you're having, you can fix it by making a single call to `DropboxClientsManager.unlinkClient()` in your code.

As of the latest version of SwiftyDropbox, we've removed these cumbersome assert statements, so you can also pull the latest version of SwiftyDropbox with `carthage update`, and that should fix the problem as well.

Sorry for the inconvenience! Let us know if this solves your problem

Wilfried S.
New member | Level 1

I tried to create an app using dropbox and I did as described at the GitHub site. the batch file is working find, but when I open de workspace in xCode 8 I get 190 errors at Alamofire. What can I do to fix it. Is there a wrong version of Alamofire? but where I will get the right version? Is it be possible to download it, but where it has to be installed at my computer? 

Is there anybody who can help me, perhaps someone who was successful in installing the dropbox component. 

thank you for your help

Wilfried

Greg-DB
Dropbox Staff

Wilfried, we'll be happy to help with this. Please open a new thread with the details of the issues you've run in to (e.g., the exact steps you followed, and the errors you're getting):

https://www.dropboxforum.com/hc/en-us/community/posts/new?community_post%5Btopic_id%5D=200209245

For reference though, since it sounds like maybe this is due to the version of Swift, if you're using Swift 3 in your project, you can should the default master branch of SwiftyDropbox, but if you're using Swift 2.3, you need to use the swift_2_3 branch as documented here.

Need more support?