问题
I want to make an app that lets a user upload a file to dropbox and then get options to share that file. How can I get a dropbox link for a file? It seems like I could use client.sharing.createSharedLink(path:"/myfile") but how would I access that data as a String?
回答1:
Here's a sample of how you could use createSharedLink in SwiftyDropbox to get a shared link to a file, in this example at the path /test.txt.
Dropbox.authorizedClient!.sharing.createSharedLink(path: "/test.txt").response({ response, error in
if let link = response {
print(link.url)
} else {
print(error!)
}
})
来源:https://stackoverflow.com/questions/34212268/how-to-get-share-link-with-dropbox-api-in-swift