<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: no result by using SDK 1.3.13 and swift in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/no-result-by-using-SDK-1-3-13-and-swift/m-p/16977#M594</link>
    <description>&lt;P&gt;ok clear many thanks, I will try and keep you aware.&lt;/P&gt;

&lt;P&gt;If I am correct you are working on the APIv2, do you know when it will be available ?&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jun 2015 14:36:41 GMT</pubDate>
    <dc:creator>Ricky B.5</dc:creator>
    <dc:date>2015-06-09T14:36:41Z</dc:date>
    <item>
      <title>no result by using SDK 1.3.13 and swift</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/no-result-by-using-SDK-1-3-13-and-swift/m-p/16973#M590</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I completed some tests with success by writing code in a view controller but when I moved my code in a class (to be used in background) I have no result and no error. &lt;BR /&gt;
Could you please help ? any suggestion ?&lt;BR /&gt;
Many thanks&lt;BR /&gt;
Sébastien&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;My previous code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;class ViewController: UIViewController, DBRestClientDelegate, NSXMLParserDelegate {
    private var dbRestClient: DBRestClient?     // dropbox rest client
     @IBAction func btconnect(sender: AnyObject) {
        if !DBSession.sharedSession().isLinked() {
            // should let use know why you are asking for dropbox permissions
            // now ask for permission
            DBSession.sharedSession().linkFromController(self)
            txtLogs.insertText("linked \n")
        }
        if dbRestClient == nil {
            dbRestClient = DBRestClient(session: DBSession.sharedSession())
            dbRestClient!.delegate = self
            txtLogs.insertText("dbRestClient \n")
        }
    }

    @IBAction func btList(sender: AnyObject) {
        txtLogs.insertText("Start List \n")
        dbRestClient?.loadMetadata("/myFolder/")
        txtLogs.insertText("End List \n")
    }

    func restClient(client: DBRestClient!, loadedMetadata metadata: DBMetadata!){
        if (metadata.isDirectory) {
            println("Folder \(metadata.path) contains: \n")
            txtLogs.insertText("Folder \(metadata.path) contains: \n")
            for FILE in metadata.contents {
                println(" \(FILE.filename) \n")
                txtLogs.insertText(" \(FILE.filename) \n")
            }
        }
    }
    func restClient(client: DBRestClient!, loadMetadataFailedWithError error: NSError!){
        println("loadedMetadata failed with error: \(error)")
        activityIndicatorView.stopAnimating()
    }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;....&lt;/P&gt;

&lt;P&gt;My new code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import Foundation

class Cloud : NSObject, DBRestClientDelegate{
    private var dbRestClient: DBRestClient?     // dropbox rest client

    func DownloadMain() -&amp;gt; Bool{
        var myResult : Bool = false
        ConnectToDropBox()
        dbRestClient?.loadMetadata("/myfolder/")
return myResult
    }

    func ConnectToDropBox() {
        if !DBSession.sharedSession().isLinked() {
            // should let use know why you are asking for dropbox permissions
            // now ask for permission
            DBSession.sharedSession()//.linkFromController(self)
        }
        if dbRestClient == nil {
            dbRestClient = DBRestClient(session: DBSession.sharedSession())
            dbRestClient!.delegate = self
        }
    }

    func restClient(client: DBRestClient!, loadedMetadata metadata: DBMetadata!){
        if (metadata.isDirectory) {
            println("Folder \(metadata.path) contains: \n")
            for FILE in metadata.contents {
                println(" \(FILE.filename) \n")
            }
        }
    }

    func restClient(client: DBRestClient!, loadMetadataFailedWithError error: NSError!){
        println("loadedMetadata failed with error: \(error)")
    }
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:42:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/no-result-by-using-SDK-1-3-13-and-swift/m-p/16973#M590</guid>
      <dc:creator>Ricky B.5</dc:creator>
      <dc:date>2019-05-29T09:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: no result by using SDK 1.3.13 and swift</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/no-result-by-using-SDK-1-3-13-and-swift/m-p/16974#M591</link>
      <description>&lt;P&gt;You need to call &lt;CODE&gt;DBSession.sharedSession().linkFromController(self)&lt;/CODE&gt; from your visible view controller.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2015 02:37:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/no-result-by-using-SDK-1-3-13-and-swift/m-p/16974#M591</guid>
      <dc:creator>Leah C.1</dc:creator>
      <dc:date>2015-06-09T02:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: no result by using SDK 1.3.13 and swift</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/no-result-by-using-SDK-1-3-13-and-swift/m-p/16975#M592</link>
      <description>&lt;P&gt;hello Leah,&lt;BR /&gt;
thanks for your response.&lt;BR /&gt;
Sorry but I don't understand, I would like to run my class cloud in background so I guess there is no visible viewController ?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2015 03:23:41 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/no-result-by-using-SDK-1-3-13-and-swift/m-p/16975#M592</guid>
      <dc:creator>Ricky B.5</dc:creator>
      <dc:date>2015-06-09T03:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: no result by using SDK 1.3.13 and swift</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/no-result-by-using-SDK-1-3-13-and-swift/m-p/16976#M593</link>
      <description>&lt;P&gt;What I'm saying is that you can't do that. You need to call &lt;CODE&gt;DBSession.sharedSession().linkFromController(self)&lt;/CODE&gt; from a visible view controller. Once you have completed the authorization flow, you should be able to run the rest of the API calls in the background.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2015 05:29:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/no-result-by-using-SDK-1-3-13-and-swift/m-p/16976#M593</guid>
      <dc:creator>Leah C.1</dc:creator>
      <dc:date>2015-06-09T05:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: no result by using SDK 1.3.13 and swift</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/no-result-by-using-SDK-1-3-13-and-swift/m-p/16977#M594</link>
      <description>&lt;P&gt;ok clear many thanks, I will try and keep you aware.&lt;/P&gt;

&lt;P&gt;If I am correct you are working on the APIv2, do you know when it will be available ?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2015 14:36:41 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/no-result-by-using-SDK-1-3-13-and-swift/m-p/16977#M594</guid>
      <dc:creator>Ricky B.5</dc:creator>
      <dc:date>2015-06-09T14:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: no result by using SDK 1.3.13 and swift</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/no-result-by-using-SDK-1-3-13-and-swift/m-p/16978#M595</link>
      <description>&lt;P&gt;Yes, we're working on a new API (v2) which is in preview mode so you can try it out but we don't recommend using it in production apps yet. I don't have an estimate on exactly when it will be complete. In the meantime, feel free to test out the Swift SDK (&lt;A href="https://blogs.dropbox.com/developers/2015/05/try-out-swiftydropbox-the-new-swift-sdk-for-dropbox-api-v2/" rel="nofollow noreferrer"&gt;https://blogs.dropbox.com/developers/2015/05/try-out-swiftydropbox-the-new-swift-sdk-for-dropbox-api-v2/&lt;/A&gt;) or the HTTP API itself (&lt;A href="https://blogs.dropbox.com/developers/2015/04/a-preview-of-the-new-dropbox-api-v2/" rel="nofollow noreferrer"&gt;https://blogs.dropbox.com/developers/2015/04/a-preview-of-the-new-dropbox-api-v2/&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2015 01:25:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/no-result-by-using-SDK-1-3-13-and-swift/m-p/16978#M595</guid>
      <dc:creator>Leah C.1</dc:creator>
      <dc:date>2015-06-10T01:25:50Z</dc:date>
    </item>
  </channel>
</rss>

