title: react-native iOS native module: calling method that activates network indicator asynchronously
body: <p>I am writing a native module that calls functions from a closed source framework binary that I don't have access to. It makes blocking network calls and activates the network indicator. I want to be able to run it in the background asyncronously, It kind of works out of the box, but when I do that I get this warning/error and the call stalls a bit:</p>
  
  <p><code>Main Thread Checker: UI API called on a background thread: -[UIApplication setNetworkActivityIndicatorVisible:]</code></p>
  
  <p>If I put it on the main queue using the following code in my In my RN Module, the calls block everything until they complete.</p>
  
  <pre><code>- (dispatch_queue_t)methodQueue
  {
    return dispatch_get_main_queue();
  }
  </code></pre>
  
  <p>Here is an example of a method exposed to JS:</p>
  
  <pre><code>RCT_REMAP_METHOD(createSession,
                   userIDtoken:(NSString *)userIDtoken
                   createSessionWithResolver:(RCTPromiseResolveBlock)resolve
                   rejecter:(RCTPromiseRejectBlock)reject)
  {
      Boolean connected = [_networkController startSession:userIDtoken isTest:true];
      NSString *success = @"session created";
      if (connected){
        resolve(success);
      } else {
        NSError *error = [NSError errorWithDomain:@"ConnectionError" code:1 userInfo:nil];
        reject(@"session_creation_failed", @"Cannot create sessions", error);
      }
  }
  </code></pre>
  
  <p><code>_networkController startSession</code> should run in the background without throwing the warning/error and without blocking the main thread. Is there a way to do this?</p>