title: Push notification not received when App is in Background in iOS 10
body: <p>I'm using FCM(Firebase Cloud Messaging) for sending push notifications in iOS.</p>
  
  <p>I'm able to receive the notification when App is in foreground state. But when the App is in background state, the notification is not received. Whenever the application will come to foreground state, only then will the notification be received. </p>
  
  <p>My code is:</p>
  
  <pre><code>- (void)userNotificationCenter:(UNUserNotificationCenter *)center
     willPresentNotification:(UNNotification *)notification
       withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
  // Print message ID.
  NSDictionary *userInfo = notification.request.content.userInfo;
  NSLog(@"Message ID: %@", userInfo[@"gcm.message_id"]);
  
  // Pring full message.
  NSLog(@"%@", userInfo);
  
  if( [UIApplication sharedApplication].applicationState == UIApplicationStateInactive )
  {
      NSLog( @"INACTIVE" );
      completionHandler(UNNotificationPresentationOptionAlert);
  }
  else if( [UIApplication sharedApplication].applicationState == UIApplicationStateBackground )
  {
      NSLog( @"BACKGROUND" );
      completionHandler( UNNotificationPresentationOptionAlert );
  }
  else
  {
      NSLog( @"FOREGROUND" );
      completionHandler( UNNotificationPresentationOptionAlert );
  }}
  
  
  
  - (void)applicationDidEnterBackground:(UIApplication *)application {
  
  
  }
  </code></pre>
  
  <p>When App is in background state:</p>
  
  <pre><code>- (void)userNotificationCenter:(UNUserNotificationCenter *)center
     willPresentNotification:(UNNotification *)notification
       withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler
  </code></pre>
  
  <p>-- is not called at all.</p>
  
  <p>I enabled push notifications and also remote notifications in background modes in App Capabilities. But App is still not receiving the notification.</p>
  
  <p>I referred to some StackOverflow questions but wasn't able to solve the issue. Is there anything to add in iOS version 10 or any mistake in my code?</p>