title: iOS 9 : beginBackgroundTaskWithExpirationHandler is getting called before timout
body: <p>i'm working on VOIP call and adding support to iOS &lt; 10.
  For incoming VOIP call when app is in background, i'm using UILocalNotification (deprecated in iOS 10).</p>
  
  <p>To make a call 60 secs (or 1 minute) i'm using this code </p>
  
  <pre><code>    count = 0;
                      apnTimer = [NSTimer scheduledTimerWithTimeInterval:3.0
                                                                  target:self
                                                                selector:@selector(showIncomingCall:)
                                                                userInfo:userInfo
                                                                 repeats:YES];
      self.backgroundTask = [application beginBackgroundTaskWithExpirationHandler:^{
                          NSLog(@"ALVOIP : BACKGROUND_HANDLER_NO_MORE_TASK_RUNNING.");
                          [application endBackgroundTask:self.backgroundTask]; 
                          self.backgroundTask = UIBackgroundTaskInvalid;
                      }];
  
  
      -(void)showIncomingCall:(NSTimer *)timer
  {
      if (count &lt; 60)
      {
  
              UIApplication *application = [UIApplication sharedApplication];
              [application presentLocalNotificationNow:localNotification];
              NSLog(@"Time Remaining: %f", [[UIApplication sharedApplication] backgroundTimeRemaining]);
  
          count = count + 3;
          return;
      }
  
      // TIMEOUT : STOP TIMER AND LOCAL NOTIFICATION BACKGROUND TASK
      [self invalidateCallNotifying];
  }
  
  -(void)invalidateCallNotifying
  {
      [apnTimer invalidate];
      if (self.backgroundTask != UIBackgroundTaskInvalid)
      {
          [[UIApplication sharedApplication] endBackgroundTask:self.backgroundTask];
          self.backgroundTask = UIBackgroundTaskInvalid;
      }
  }
  </code></pre>
  
  <p>to extend background process time to 1 minute and it's working in iOS 10.1.1 (iPhone) but not working in iOS 9.3.5 (iPad). Somehow handler is invoking 30-33 secs?</p>
  
  <p>UPDATE: </p>
  
  <p>i tried to comment this code :</p>
  
  <pre><code>self.backgroundTask = [application beginBackgroundTaskWithExpirationHandler:^{
                          NSLog(@"ALVOIP : BACKGROUND_HANDLER_NO_MORE_TASK_RUNNING.");
                          [application endBackgroundTask:self.backgroundTask]; 
                          self.backgroundTask = UIBackgroundTaskInvalid;
                      }];
  </code></pre>
  
  <p>Still i'm able to do 30-33 secs i.e i don't know why this is not working?</p>