Notifications locales et push dans la version IOS compatible

J'ai développé local Notifications dans iOS 10. Il fonctionne à la perfection. Mais maintenant, comment dois-je code local notifications et push notification si l'utilisateur utilise iOS 9 et versions supérieures. Quelqu'un peut-il aider s'il vous plaît?

Ci-dessous est le code dans iOS 10

import UIKit
import UserNotifications

@available(iOS 10.0, *)
class ViewController: UIViewController,UNUserNotificationCenterDelegate {
    override func viewDidLoad() {
       super.viewDidLoad()

       if #available(iOS 10.0, *) {
        //Seeking permission of the user to display app notifications
        UNUserNotificationCenter.current().requestAuthorization(options: [.alert,.sound,.badge], completionHandler: {didAllow,Error in })
        UNUserNotificationCenter.current().delegate = self

       }
   }

   //To display notifications when app is running  inforeground
   func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
       completionHandler([.alert, .sound, .badge])
   }

   override func didReceiveMemoryWarning() {
       super.didReceiveMemoryWarning()
       //Dispose of any resources that can be recreated.
   }

   @IBAction func buttonPressed(_ sender: UIButton) {

       if #available(iOS 10.0, *) {

           //Setting content of the notification
           let content = UNMutableNotificationContent()
           content.title = "hello"
           content.body = "notification pooped out"
           content.badge = 1

           //Setting time for notification trigger
           let date = Date(timeIntervalSinceNow: 10)
           var dateCompenents = Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second], from: date)

           let trigger = UNCalendarNotificationTrigger(dateMatching: dateCompenents, repeats: false)
           //Adding Request
           let request = UNNotificationRequest(identifier: "timerdone", content: content, trigger: trigger)
           UNUserNotificationCenter.current().add(request, withCompletionHandler: nil)
        }

     }

 }

source d'informationauteur sindhu kopparati