title: Background handleopenurl with Runkeeper api
body: <p>I have a problem with Runkeeper Api background handleopenurl. When app is running foreground there are no problems with it and I can get calorie data from RK. </p>
  
  <p>But I need to run this calorie fetch when the app is backgrounded. </p>
  
  <p>This code is what works when app is backgrounded:</p>
  
  <pre><code>- (NSURLRequest *) connect
  {
      NSLog(@"runkeeper connect");
      NSString *_authURL = [NSString stringWithFormat:@"%@?client_id=%@&amp;redirect_uri=%@&amp;response_type=code&amp;state=0", [auth_url absoluteString], client_id, [redirect_url absoluteString]];
  NSURLRequest *_request = [NSURLRequest requestWithURL:[NSURL URLWithString:_authURL]];
  
  return _request;
  } 
  </code></pre>
  
  <p>But after this it wont work anymore.</p>
  
  <p>So it should send the url to handleopenurl, which is in appdelegate, and then it fetch the calorie data.</p>
  
  <p>And here is my handleopenurl:</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
  {
  
  RunKeeper *runkeeper;    
  runkeeper = [RunKeeper getRunKeeper];
  
  // parsing code here
  if(url){
  
      [runkeeper parseCodeFromURL:url];
      [runkeeper fetchToken];
  
      [runkeeper fetchUser];
      [runkeeper fetchFitnessActivites];
  
      [self.second_view showInput];
  
      return true;
  }
  
  return false;
  
  }
  </code></pre>
  
  <p>However handleopenurl is not called when app is backgrounded. What should I do? I have tried many background methods but none of them seems to be working. </p>
  
  <p>All in all: Runkeeper api calorie data fetch works when app is foregrounded but it wont fetch the calorie data when app is backgrounded. I think the problem is with handleopenurl.</p>