title: Local Notifications swift 3
body: <p>I am trying to send a notification on a button click. This is the code in my viewController:</p>
  
  <pre><code>@IBAction func getNotificationButtonPressed(_ sender: Any) {
      let content = UNMutableNotificationContent()
      content.title = "Title"
      content.body = "Body"
      content.categoryIdentifier = "ident"
      content.sound = UNNotificationSound.default()
  
      let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 0.1, repeats: false)
  
      let request = UNNotificationRequest(identifier: "ident", content: content, trigger: trigger)
  
      let center = UNUserNotificationCenter.current()
  
      center.add(request) { (error : Error?) in
          if let theError = error {
              print(theError.localizedDescription)
          } else {
              print ("success")
          }
      }
  }
  </code></pre>
  
  <p>also in AppDelegate I have requested permission to use Notifications:</p>
  
  <pre><code>let center = UNUserNotificationCenter.current()
      center.requestAuthorization(options:[.badge, .alert, .sound]) { (granted, error) in
          // Enable or disable features based on authorization.
      }
      application.registerForRemoteNotifications()
  </code></pre>
  
  <p>P.S. I have imported </p>
  
  <pre><code>import UserNotifications
  </code></pre>
  
  <p>in both AppDelegate and the custom ViewController.</p>