title: Handle notification click in WebView
body: <p>I'm trying to display a specific webView url when user click on a notification, but I'm not in capacity to handle click event when user receive and click to the notification.</p>
  <p>Even the print isn't on my console, idk what I'm doing wrong</p>
  <pre><code>//AppDeletage.swift
  // Require notification Authorization
  class AppDelegate: UIResponder, UIApplicationDelegate {
  
     weak var viewController : ViewController?
  
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {
        // Override point for customization after application launch.
        registerForPushNotifications()
        
        // When the app launch after user tap on notification (originally was not running / not in background)
        if(launchOptions?[UIApplication.LaunchOptionsKey.remoteNotification] != nil){
           print(&quot;Notification handle&quot;)
        }
           
        return true
     }
  
     func registerForPushNotifications() {
        UNUserNotificationCenter.current()
           .requestAuthorization(options: [.alert, .sound, .badge]) {
           [weak self] granted, error in
              
           print(&quot;Permission granted: \(granted)&quot;)
  
           self?.viewController?.loadRequestWithoutToken()
           
           guard granted else { return }
           self?.getNotificationSettings()
        }
     }
  
     // Get notification settings
     func getNotificationSettings() {
     UNUserNotificationCenter.current().getNotificationSettings { settings in
        print(&quot;Notification settings: \(settings)&quot;)
        guard settings.authorizationStatus == .authorized else { return }
        DispatchQueue.main.async {
           UIApplication.shared.registerForRemoteNotifications()
        }
     }
     }
  
     func application(
     _ application: UIApplication,
     didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data
     ) {
           let tokenParts = deviceToken.map { data in String(format: &quot;%02.2hhx&quot;, data) }
           let token = tokenParts.joined()
           print(&quot;Device Token: \(token)&quot;)
        
        viewController?.loadRequest(for: token)
  
     }
  
     func application(
     _ application: UIApplication,
     didFailToRegisterForRemoteNotificationsWithError error: Error) {
           viewController?.loadRequestWithoutToken()
        print(&quot;Failed to register: \(error)&quot;)
     }
  }
  
  extension AppDelegate: UNUserNotificationCenterDelegate{
      
    // This function will be called right after user tap on the notification
    func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -&gt; Void) {
  
       print(&quot;User has click on notification&quot;)
  
      let myURL = &quot;https://app.jmt-alimentation-animale.com/index.php/news/single/80225&quot;
      let URLWithToken = URL(string: myURL)
      let URLWebView = URLRequest(url: URLWithToken!)
  
      viewController?.webView.load(URLWebView)
      // tell the app that we have finished processing the user’s action / response
      completionHandler()
    }
  }
  </code></pre>
  <p>If someone could help me to, at least, get the handle of notification tap, It will be great. Thanks</p>