title: How to send push notification in iOS 10 via FCM(Firebase) or by native?
body: <p>I am developing an app which has deployment target iOS 7.1. I am using Firebase for the push notifications. Push notifications working fine in the iOS 9 devices. But not working in the iOS 10 devices.</p>
  
  <p>When I searched, I found this note <a href="https://firebase.google.com/docs/cloud-messaging/ios/client" rel="nofollow">here</a>.</p>
  
  <pre><code>if (floor(NSFoundationVersionNumber) &lt;= NSFoundationVersionNumber_iOS_9_x_Max) {
    UIUserNotificationType allNotificationTypes =
    (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge);
    UIUserNotificationSettings *settings =
    [UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];
    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
  } else {
    // iOS 10 or later
    #if defined(__IPHONE_10_0) &amp;&amp; __IPHONE_OS_VERSION_MAX_ALLOWED &gt;= __IPHONE_10_0
    UNAuthorizationOptions authOptions =
        UNAuthorizationOptionAlert
        | UNAuthorizationOptionSound
        | UNAuthorizationOptionBadge;
    [[UNUserNotificationCenter currentNotificationCenter]
        requestAuthorizationWithOptions:authOptions
        completionHandler:^(BOOL granted, NSError * _Nullable error) {
        }
     ];
  
    // For iOS 10 display notification (sent via APNS)
    [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];
    // For iOS 10 data message (sent via FCM)
    [[FIRMessaging messaging] setRemoteMessageDelegate:self];
    #endif
  }
  </code></pre>
  
  <p>And this note:</p>
  
  <blockquote>
    <p>Important: for devices running iOS 10 and above, you must assign your delegate object to the UNUserNotificationCenter object to receive display notifications.</p>
  </blockquote>
  
  <p>Is it necessary to send push notification via this method (which is a new class <code>UNUserNotificationCenter</code>)? is it be possible through the old push notification registration methods?</p>
  
  <p>Please let me know. Because of this, I need to update my project to the Swift version 2.3 or 3.0, and it will take time.</p>