Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I've followed the SwiftyDropbox tutorial and after linking the app to my (user) db account the app just quits with out throwing any errors after the redirect back to the app.
This is my console output.
These "errors" occur after the button press.
I don't get a console print saying
"Success! User is logged into Dropbox with token: \(token)"
This is my VC.swift
This is the relevant code in my AppDelegate.swfit
Console output
What version of iOS are you running? The only thing that looks potentially wrong is that you're using the older version of the openURL method.
There's a note in the tutorial here about that:
https://www.dropbox.com/developers/documentation/swift#tutorial
You can use this version for 9.0+:
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
The version you're using is for <9.0:
func application(app: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
Thanks for the response.
I am on iOS 9,
I made the code change to the appropriate openURL method and It still fails to redirect.
When I get to the DB login screen and hit "Cancel" It also fails to redirect.
This is my info.plist
and code for relevant section:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>dbapi-2</string>
<string>dbapi-8-emm</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>db-u3tf1l9k3flsira</string>
</array>
</dict>
</array>
Thanks for the additional information. In your original post though, you said "the app just quits with out throwing any errors after the redirect back to the app", however in your last reply you said it "still fails to redirect". Can you clarify what redirect does or doesn't occur, and when the app quits exactly?
In any case, if you can provide a sample project, that would be most helpful so we can reproduce it and look into it. Thanks in advance!
It segues back to a white screen and then the app quits
Here is my project
Thanks Jordan! That actually works fine for me though. I get redirected back to the test app and get the "Success! User is logged into Dropbox with token: ..." message on a device running iOS 9 with the official Dropbox app installed.
Is this happening on multiple devices/simulators for you?
You may also want to try deleting the Pods and reinstalling with pod install just in case something was broken in your pod installation.
I've got the similar problem (I can't see your image, it's link was broken), but I found that the reason I've got this problem is because I was changing the name of my app, however the old copy of the app is still installed on the device, therefore, while dropbox api redirect, it go to the old app rather than the new app, so I remove the old app and everything work perfectly!
Hi there!
If you need more help you can view your support options (expected response time for a 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!