title: How to enable push notification from app settings in iOS Swift 5?
body: <p>In my application I have in app settings for enabling/disabling push notifications. 
  I ran into a case in which if user Don't allow notifications when the application launches and then enables it with Settings in the Application then authorization status is always Denied. </p>
  
  <p>Here is my code for push notification in app delegate.<br>
  I have called registerForPushNotifications method in didFinishLaunching.</p>
  
  <pre><code>// MARK: Register app for push notificaitons
      func registerForPushNotifications() {
          UNUserNotificationCenter.current().delegate = self
          UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) {
            [weak self] granted, error in
            printLogs("Permission granted: \(granted)")
           // guard granted else { return }
              if error == nil {
                  self?.getNotificationSettings()
              }
  
        }
      }
  
  func getNotificationSettings() {
      UNUserNotificationCenter.current().getNotificationSettings { settings in
          printLogs("Notification settings: \(settings)")
          switch settings.authorizationStatus {
          case .authorized:
              DispatchQueue.main.async {
                  UIApplication.shared.registerForRemoteNotifications()
              }
          case .denied:
              printLogs("Notifications Denied")
  
          case .notDetermined:
              printLogs("Notifications not determined")
          default:
              break
          }
  
      }
  }
  </code></pre>
  
  <p>and for enabling notifications from settings I am using this code</p>
  
  <pre><code> AppDelegate.shared.registerForRemoteNotifications()
  </code></pre>