title: Swift - Local Notification doesn't get triggered
body: <p>I am coding in Swift 3 and I am simply trying to send a notification <strong>now</strong> without any delays or intervals. However the notification never gets triggered. Here's my code..</p>
  
  <p><strong>The ViewController code</strong></p>
  
  <pre><code>import UserNotifications
  
  class HomeViewController: UIViewController{
      var isGrantedNotificationAccess:Bool = false
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          UNUserNotificationCenter.current().requestAuthorization(
              options: [.alert,.sound,.badge],
              completionHandler: { (granted,error) in
                  self.isGrantedNotificationAccess = granted
          })
  
          if isGrantedNotificationAccess{
              triggerNotification()
          }
      }
  
      //triggerNotification func goes here
  }
  </code></pre>
  
  <p><strong>triggerNotification function:</strong></p>
  
  <pre><code>func triggerNotification(){
      let content = UNMutableNotificationContent()
      content.title = NSString.localizedUserNotificationString(forKey: "Notification Testing", arguments: nil)
      content.body = NSString.localizedUserNotificationString(forKey: "This is a test", arguments: nil)
      content.sound = UNNotificationSound.default()
      content.badge = (UIApplication.shared.applicationIconBadgeNumber + 1) as NSNumber;
      let trigger = UNTimeIntervalNotificationTrigger(
          timeInterval: 1.0,
          repeats: false)
  
      let request = UNNotificationRequest.init(identifier: "testTriggerNotif", content: content, trigger: trigger)
  
      let center = UNUserNotificationCenter.current()
      center.add(request)
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>