<?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 Obj-C API-2 Equivalent of DBRequest networkRequestDelegate? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-API-2-Equivalent-of-DBRequest-networkRequestDelegate/m-p/192102#M8493</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In API-1, I could easily set iOS's activity spinner going whenever Dropbox accessed the network like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;- (BOOL)application:(UIApplication * )application didFinishLaunchingWithOptions:(NSDictionary * )launchOptions
{
    [DBRequest setNetworkRequestDelegate:self];
}

// DBNetworkRequestDelegate - these delegate methods allow us to show and hide the network
// activity spinner in the status bar when Dropbox is doing something.

static NSInteger outstandingDropboxNetworkRequests = 0;
- (void)networkRequestStarted
{
    outstandingDropboxNetworkRequests++;
    if (outstandingDropboxNetworkRequests == 1)
    {
        [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
    }
}
- (void)networkRequestStopped
{
    outstandingDropboxNetworkRequests--;
    if (outstandingDropboxNetworkRequests == 0)
    {
        [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
    }
}&lt;/PRE&gt;&lt;P&gt;How do I do the same in API 2?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Keith&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:28:54 GMT</pubDate>
    <dc:creator>Keith B.7</dc:creator>
    <dc:date>2019-05-29T09:28:54Z</dc:date>
    <item>
      <title>Obj-C API-2 Equivalent of DBRequest networkRequestDelegate?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-API-2-Equivalent-of-DBRequest-networkRequestDelegate/m-p/192102#M8493</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In API-1, I could easily set iOS's activity spinner going whenever Dropbox accessed the network like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;- (BOOL)application:(UIApplication * )application didFinishLaunchingWithOptions:(NSDictionary * )launchOptions
{
    [DBRequest setNetworkRequestDelegate:self];
}

// DBNetworkRequestDelegate - these delegate methods allow us to show and hide the network
// activity spinner in the status bar when Dropbox is doing something.

static NSInteger outstandingDropboxNetworkRequests = 0;
- (void)networkRequestStarted
{
    outstandingDropboxNetworkRequests++;
    if (outstandingDropboxNetworkRequests == 1)
    {
        [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
    }
}
- (void)networkRequestStopped
{
    outstandingDropboxNetworkRequests--;
    if (outstandingDropboxNetworkRequests == 0)
    {
        [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
    }
}&lt;/PRE&gt;&lt;P&gt;How do I do the same in API 2?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Keith&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:28:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-API-2-Equivalent-of-DBRequest-networkRequestDelegate/m-p/192102#M8493</guid>
      <dc:creator>Keith B.7</dc:creator>
      <dc:date>2019-05-29T09:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Obj-C API-2 Equivalent of DBRequest networkRequestDelegate?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-API-2-Equivalent-of-DBRequest-networkRequestDelegate/m-p/192182#M8510</link>
      <description>&lt;P&gt;Hi Keith, no, the Objective-C SDK doesn't have anything quite like that.&lt;BR /&gt;&lt;BR /&gt;You should still be able to do effectively the same thing though, by keeping track of the number of outstanding requests, similar to what you already have, by incrementing a counter each time you start a request and decrementing it each response handler.&lt;BR /&gt;&lt;BR /&gt;We'll consider this a feature request for an easier way to do this though.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 21:12:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-API-2-Equivalent-of-DBRequest-networkRequestDelegate/m-p/192182#M8510</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-10-26T21:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Obj-C API-2 Equivalent of DBRequest networkRequestDelegate?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-API-2-Equivalent-of-DBRequest-networkRequestDelegate/m-p/192211#M8517</link>
      <description>&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the answer. That's a good idea - following our discussion about cancelling all tasks, I created a "Dropbox task manager" class that I use to invoke all the -response: and -progress: methods for tasks passed into it so that it can keep an array of all running tasks.&amp;nbsp;So I've placed the notifications in there - I should have thought of that myself. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and all the best,&lt;BR /&gt;Keith&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 08:49:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obj-C-API-2-Equivalent-of-DBRequest-networkRequestDelegate/m-p/192211#M8517</guid>
      <dc:creator>Keith B.7</dc:creator>
      <dc:date>2016-10-27T08:49:49Z</dc:date>
    </item>
  </channel>
</rss>

