<?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: [DBRestClient] uploadFile: doesn't prevent my app from being killed in background in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/DBRestClient-uploadFile-doesn-t-prevent-my-app-from-being-killed/m-p/147313#M4785</link>
    <description>&lt;P&gt;[Thanks for reposting. The API development forum is the right one for anything API related. The "Bugs &amp;amp; Troubleshooting" forum is more about the&amp;nbsp;Dropbox product itself. I've deleted your other post so we can consolidate here.]&lt;/P&gt;
&lt;P&gt;Anyway, the &lt;A href="https://www.dropbox.com/developers/core/sdks/ios" target="_blank" rel="nofollow noreferrer"&gt;Dropbox iOS Core SDK&lt;/A&gt;&amp;nbsp;doesn't use&amp;nbsp;NSURLSession. It's a wrapper around the HTTP endpoints that uses&amp;nbsp;NSURLRequest, so you'll need to configure any&amp;nbsp;background functionality as necessary for your app in your&amp;nbsp;app code. (The iOS Core SDK is open source though, so alternatively you could add the source directly and modify it as desired instead.) We don't&amp;nbsp;we have any sample code for this in particular however.&lt;/P&gt;
&lt;P&gt;We'll consider this a feature request though. Also, I believe our new &lt;A href="https://github.com/dropbox/SwiftyDropbox" target="_blank" rel="nofollow noreferrer"&gt;SwiftyDropbox&lt;/A&gt;&amp;nbsp;library, for the Dropbox API v2, currently in preview, does use&amp;nbsp;NSURLSession via AlamoFire.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2015 00:08:47 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2015-09-29T00:08:47Z</dc:date>
    <item>
      <title>[DBRestClient] uploadFile: doesn't prevent my app from being killed in background</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/DBRestClient-uploadFile-doesn-t-prevent-my-app-from-being-killed/m-p/147312#M4784</link>
      <description>&lt;P&gt;&lt;EM&gt;[Re-posting it here, since I think I posted it in the wrong category earlier, sorry for that]&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm using Dropbox SDK to upload a file after my app is awakened&amp;nbsp;by iOS through a Silent Notification.&lt;/P&gt;
&lt;P&gt;The problem is : The transfer begin but&amp;nbsp;my app is killed by iOS before it can finish. I can see its progress when logging the output of&amp;nbsp;&lt;SPAN class="s1"&gt;restClient:&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;uploadProgress: and it&amp;nbsp;doesn't have the time to finish.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I thought that when making background downloads or uploads, if we used NSURLSession, iOS detects it and wait for it to finish. Do you guys use it in your SDK ?&lt;/P&gt;
&lt;P&gt;Interesting facts :&lt;/P&gt;
&lt;P&gt;- I don't have any problem when uploading the same file on iCloud with iCloudDocumentSync.&lt;/P&gt;
&lt;P&gt;- The problem doesn't occur when the app is not killed before iOS awaken it with Silent Notifications. By killing, I don't mean closing it from the app switcher, but by terminating it with the "Stop" button from Xcode while it's in background (It's the best way I found in order to simulate the fact that sometimes iOS kill your app while it's in background (like after you played a game and iOS freed all the memory it could)).&lt;/P&gt;
&lt;P&gt;- I tried to schedule the RunLoop to keep working for 2 minutes, but iOS still kills it.&lt;/P&gt;
&lt;P&gt;- I'm on the main thread&amp;nbsp;when I'm doing the upload.&lt;/P&gt;
&lt;P&gt;- I didn't fire the&amp;nbsp;UIBackgroundFetchResult completion handler before it was killed.&lt;/P&gt;
&lt;P&gt;- The message iOS displays is Xcode devices :&lt;/P&gt;
&lt;P&gt;Sep 20 16:32:20 Jbs-iPhone-5 assertiond[69] &amp;lt;Warning&amp;gt;: &amp;lt;BKNewProcess: 0x15662ea00; com.*********.********; pid: 374; hostpid: -1&amp;gt; has active assertions beyond permitted time: &lt;BR /&gt;{(&lt;BR /&gt;&amp;lt;BKProcessAssertion: 0x156522220&amp;gt; id: 57-6838B6CE-8BAA-4BFD-83C7-BCD5E475779D name: Background Content Fetching (23) process: &amp;lt;BKNewProcess: 0x15662ea00; com.********.*********; pid: 374; hostpid: -1&amp;gt; permittedBackgroundDuration: 30.000000 reason: backgroundContentFetching owner pid:57 preventSuspend preventThrottleDownUI preventIdleSleep preventSuspendOnSleep &lt;BR /&gt;)}&lt;/P&gt;
&lt;P&gt;Then in my Device logs, I have this crash log :&lt;/P&gt;
&lt;P&gt;Application Specific Information:&lt;BR /&gt;com.*********.********failed to scene-create after 19.73s (launch took 0.27s of total time limit 20.00s)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance, I really hope you'll be able to help me.&lt;/P&gt;
&lt;P&gt;Jean-Baptiste&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:39:43 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/DBRestClient-uploadFile-doesn-t-prevent-my-app-from-being-killed/m-p/147312#M4784</guid>
      <dc:creator>Jean-Baptiste D2</dc:creator>
      <dc:date>2019-05-29T09:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: [DBRestClient] uploadFile: doesn't prevent my app from being killed in background</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/DBRestClient-uploadFile-doesn-t-prevent-my-app-from-being-killed/m-p/147313#M4785</link>
      <description>&lt;P&gt;[Thanks for reposting. The API development forum is the right one for anything API related. The "Bugs &amp;amp; Troubleshooting" forum is more about the&amp;nbsp;Dropbox product itself. I've deleted your other post so we can consolidate here.]&lt;/P&gt;
&lt;P&gt;Anyway, the &lt;A href="https://www.dropbox.com/developers/core/sdks/ios" target="_blank" rel="nofollow noreferrer"&gt;Dropbox iOS Core SDK&lt;/A&gt;&amp;nbsp;doesn't use&amp;nbsp;NSURLSession. It's a wrapper around the HTTP endpoints that uses&amp;nbsp;NSURLRequest, so you'll need to configure any&amp;nbsp;background functionality as necessary for your app in your&amp;nbsp;app code. (The iOS Core SDK is open source though, so alternatively you could add the source directly and modify it as desired instead.) We don't&amp;nbsp;we have any sample code for this in particular however.&lt;/P&gt;
&lt;P&gt;We'll consider this a feature request though. Also, I believe our new &lt;A href="https://github.com/dropbox/SwiftyDropbox" target="_blank" rel="nofollow noreferrer"&gt;SwiftyDropbox&lt;/A&gt;&amp;nbsp;library, for the Dropbox API v2, currently in preview, does use&amp;nbsp;NSURLSession via AlamoFire.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 00:08:47 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/DBRestClient-uploadFile-doesn-t-prevent-my-app-from-being-killed/m-p/147313#M4785</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-09-29T00:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: [DBRestClient] uploadFile: doesn't prevent my app from being killed in background</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/DBRestClient-uploadFile-doesn-t-prevent-my-app-from-being-killed/m-p/147314#M4786</link>
      <description>&lt;P&gt;That's great! I'm gonna try these this WE!&lt;/P&gt;
&lt;P&gt;I'll let you know how it goes and&amp;nbsp;which solution worked best for me.&lt;/P&gt;
&lt;P&gt;Thank you very much for your help &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@13532C4C3505179FBF012F1C117AE2EB/emoticons/1f604.png" alt=":grinning_face_with_smiling_eyes:" title=":grinning_face_with_smiling_eyes:" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 03:39:48 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/DBRestClient-uploadFile-doesn-t-prevent-my-app-from-being-killed/m-p/147314#M4786</guid>
      <dc:creator>Jean-Baptiste D2</dc:creator>
      <dc:date>2015-10-01T03:39:48Z</dc:date>
    </item>
  </channel>
</rss>

