Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Ricky B.5
10 years agoNew member | Level 1
SDK1.3.13 and Swift
Hello,
I try to develop a very simple application connected with DropBox.
I am looking for example in swift (not in objective C), could you please help me ?
Need to connect, and retrieve list...
Ricky B.5
10 years agoNew member | Level 1
hello,
thanks for your reply, I make some progress because i discovered an example (https://github.com/tkunstek/elevenchat/tree/master/ElevenChat)
Now i am facing an issue when I try to loadmetadata
loadedMetadata failed with error: Error Domain=dropbox.com Code=400 "The operation couldn’t be completed. (dropbox.com error 400.)" UserInfo=0x7fe6f1411c10 {path=/, error=App folder (sandbox) access attempt failed because this app is not configured to have an app folder. Should your access type be 'dropbox' instead?}
my code below:
// dropbox rest client
private var dbRestClient: DBRestClient?
@IBAction func btconnect(sender: AnyObject) {
if !DBSession.sharedSession().isLinked() {
// should let use know why ayou are asking for dropbox permissions
// now ask for permission
DBSession.sharedSession().linkFromController(self)
}
if dbRestClient == nil {
dbRestClient = DBRestClient(session: DBSession.sharedSession())
dbRestClient!.delegate = self
}
}
@IBAction func btList(sender: AnyObject) {
dbRestClient?.loadMetadata("/")
}
func restClient(client: DBRestClient!, loadedMetadata metadata: DBMetadata!){
if (metadata.isDirectory) {
println("Folder \(metadata.path) contains:")
for FILE in metadata.contents {
println(" \(FILE.filename)");
}
}
}
func restClient(client: DBRestClient!, loadMetadataFailedWithError error: NSError!){
println("loadedMetadata failed with error: \(error)")
}
any idea ?
Thanks
Sébastien
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!