<?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: Objective-C Api handle connection loss in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Objective-C-Api-handle-connection-loss/m-p/252113#M14531</link>
    <description>The upload and download calls in the API v2 Objective-C SDK use background NSURLSessions, which do behave as described. If you want more responsive error callbacks for this, you can change this for foreground sessions. You can find more information on this under "Note about background sessions" here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-obj-c#note-about-background-sessions" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-obj-c#note-about-background-sessions&lt;/A&gt;</description>
    <pubDate>Fri, 10 Nov 2017 16:51:29 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-11-10T16:51:29Z</dc:date>
    <item>
      <title>Objective-C Api handle connection loss</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Objective-C-Api-handle-connection-loss/m-p/252022#M14525</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For our iOS Apps we are switching from the old Dropbox Api to the new Objective-C Api. In one app we use only the download function with dropbox. To achieve this, we implement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DBUserClient *client = [DBClientsManager authorizedClient];
DBDownloadDataTask *task = (DBDownloadDataTask* ) [client.filesRoutes downloadUrl:path overwrite: true destination: destinationUrl];
[task setResponseBlock:(^(DBFILESFileMetadata *result, DBFILESDownloadError *routeError, DBRequestError *networkError, NSData *fileData) {
&amp;nbsp; &amp;nbsp;// ....
})];
[task setProgressBlock:(^(int64_t bytesDownloaded, int64_t totalBytesDownloaded, int64_t totalBytesExpectedToDownload) {
&amp;nbsp; &amp;nbsp;// ...
})];&lt;/PRE&gt;&lt;P&gt;Everything works fine, but now we want to handle connection losses, such as sudden Wi-Fi disconnections or 100% network loss with Network Link Conditioner. We don't know how to handle connection losses. The only reaction by the framework is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NSURLConnection finished with error - code -1001
Task &amp;lt;96CC094A-A747-44D4-A6A5-1B016F07AE06&amp;gt;.&amp;lt;0&amp;gt; HTTP load failed (error code: -999 [1:89])&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The framework waits, until a working connection is available. But nothing will be triggered, we can't save the files which are not downloaded successfully. I wish to set a timeout somewhere. We have always the scenario that we must sync a huge amount of data, so we only want to download the files which are not downloaded successfully...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help? Greetings!&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:17:27 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Objective-C-Api-handle-connection-loss/m-p/252022#M14525</guid>
      <dc:creator>bughunter</dc:creator>
      <dc:date>2019-05-29T09:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Objective-C Api handle connection loss</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Objective-C-Api-handle-connection-loss/m-p/252113#M14531</link>
      <description>The upload and download calls in the API v2 Objective-C SDK use background NSURLSessions, which do behave as described. If you want more responsive error callbacks for this, you can change this for foreground sessions. You can find more information on this under "Note about background sessions" here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-obj-c#note-about-background-sessions" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-obj-c#note-about-background-sessions&lt;/A&gt;</description>
      <pubDate>Fri, 10 Nov 2017 16:51:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Objective-C-Api-handle-connection-loss/m-p/252113#M14531</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-11-10T16:51:29Z</dc:date>
    </item>
  </channel>
</rss>

