2

I trying to implement Dropbox Chooser framework in my ios/swift projcet. Everything looks good. But I can't receive link when choose file from Dropbox. Only I see dialog with text "generating link" for a second in Dropbox app. Where is my problem? And sorry for my bad english.

Here is my button in my UIViewController:

func dropboxBtn(sender: AnyObject) { // println("dropboxBtn") let dbChooser = DBChooser(appKey: "drop-in-app-key") dbChooser.openChooserForLinkType(DBChooserLinkTypePreview, fromViewController: self, completion: { (results: [AnyObject]!) -> Void in println(results.description) }) } 

And here is my application function in AppDelegate.swift

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool { println("openURL") let dbChooser = DBChooser(appKey: "drop-in-app-key") if (dbChooser.handleOpenURL(url)) { return true } return false } 

I don't receive anything in the console...

1 Answer 1

1

I found my problem! I forgot this configuration -> In the URL Schemes enter db-APP_KEY (replacing APP_KEY with the key generated when you created your app). And now my methods is changed. In my UIViewController:

func dropboxBtn(sender: AnyObject) { DBChooser.defaultChooser().openChooserForLinkType(DBChooserLinkTypePreview, fromViewController: self, completion: { (results: [AnyObject]!) -> Void in println(results.description) }) } 

In my AppDelegate.swift:

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool { if (DBChooser.defaultChooser().handleOpenURL(url)) { return true } return false } 
Sign up to request clarification or add additional context in comments.

3 Comments

do you really paste the same code into your VC and your appdelegate?
This is working, thanks, but I see this warning in the console after returning to my app after Dropbox: CFNetwork SSLHandshake failed (-9806). Have you ever seen/fixed this?
Hm, I never before seeing this warning. Try to search in other question for this. I can't help, sorry.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.