title: Inconsistent behavior of openParentApplication in my WatchKit App
body: <p>I'm developing an Apple Watch application that uses the <code>openParentApplication:reply:</code> method to communicate with its parent app.</p>
  
  <p>The parent app communicates with a web service and sends back the data it gets to the watch extension by means of calling the <code>reply</code> method with a <code>NSDictionary</code> containing the data. </p>
  
  <p>The app works perfectly when the parent app is open in the foreground or background. But if I open the  parent app and then terminate it using the task switcher, the first time the watch extension makes a call to <code>openParentApplication:replyInfo:</code>, it gets the following error and the parameter <code>replyInfo</code> comes in as nil.</p>
  
  <p><code>UIApplicationDelegate in the iPhone App never called reply()</code> </p>
  
  <p>But every single <code>openParentApplication:replyInfo:</code> call the extension makes after that gets a proper response. </p>
  
  <p>I checked and found out that the first time the watch extension makes the call, the <code>handleWatchKitExtensionRequest:reply:</code> is never get called on the parent app.</p>
  
  <p>What could be the possible reason for this?</p>
  
  <p>I'm performing all operations in the <code>handleWatchKitExtensionRequest:reply:</code> in a background task, as suggested in the docs. Here's some of my code:
  Code from my extension:</p>
  
  <pre><code>NSDictionary *params = @{@"requestCode": @(RequestGetLoggedIn)};
  
  [WKInterfaceController openParentApplication:params reply:^(NSDictionary *replyInfo, NSError *error) {
      // Do something with the result
  }];
  </code></pre>
  
  <p>Code from the parent app:</p>
  
  <pre><code>- (void)application:(UIApplication *)application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void (^)(NSDictionary *))reply
  {
      self.backgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
          [[UIApplication sharedApplication] endBackgroundTask:self.backgroundTask];
      }];
  
      NSNumber* requestCode = userInfo[@"requestCode"];
  
      // Perform some request and then call reply()
  
      // End the background task
      dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
          [[UIApplication sharedApplication] endBackgroundTask:self.backgroundTask];
      });
  }
  </code></pre>
  
  <p><strong>Edit 1:</strong> The problem occurs both on the Simulator and on a real Apple Watch.</p>