title: Firebase Deeplink not calling application:continueUserActivity:restorationHandler function of AppDelegate in Swift 3
body: <p>I am using firebase Deeplink URL to open my app's specific section. It is working well when app running in background but when I killed the app and click deeplink url from outside than I don't know how to handle that case, I mean where I should write my condition to get the parameters of url.</p>
  
  <p>This method of app delegate called when app in background </p>
  
  <pre><code>   @available(iOS 8.0, *)
  func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -&gt; Void) -&gt; Bool {
      guard let dynamicLinks = DynamicLinks.dynamicLinks() else {
          return false
      }
      let handled = dynamicLinks.handleUniversalLink(userActivity.webpageURL!) { (dynamiclink, error) in
          if let dynamicLink = dynamiclink, let _ = dynamicLink.url
          {
              var path = dynamiclink?.url?.path
              path?.remove(at: (path?.startIndex)!)
              let delimiter = "/"
              var fullNameArr = path?.components(separatedBy: delimiter)
              let type: String = fullNameArr![0]
              let Id: String? = (fullNameArr?.count)! &gt; 1 ? fullNameArr?[1] : nil
              if(type == "games")
              {
                  self.callGameDetailView(gameId: Id! , gameType: "created", notificationId: "NIL" )
  
              }else{
                  var paths = dynamicLink.url?.path
                  paths?.remove(at: (path?.startIndex)!)
                  self.setRewardViewController(paths!)
  
              }
          } else {
              // Check for errors
          }
      }
      return handled
  }
  </code></pre>
  
  <p>but it will not call open url method when I killed the app and hit the dynamic link url: </p>
  
  <pre><code>@available(iOS 9.0, *)
  func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any])
      -&gt; Bool {
  
     return self.application(application, open: url, sourceApplication: nil, annotation: [:])
  
  
  }
  
  
  func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -&gt; Bool {
  
      let dynamicLink = DynamicLinks.dynamicLinks()?.dynamicLink(fromCustomSchemeURL: url)
      if let dynamicLink = dynamicLink
      {
          var path = dynamicLink.url?.path
          path?.remove(at: (path?.startIndex)!)
          let delimiter = "/"
          var fullNameArr = path?.components(separatedBy: delimiter)
          let type: String = fullNameArr![0]
          let Id: String? = (fullNameArr?.count)! &gt; 1 ? fullNameArr?[1] : nil
          if(type == "games")
          {
              self.callGameDetailView(gameId: Id! , gameType: "created", notificationId: "NIL" )
  
          }else{
              var paths = dynamicLink.url?.path
              paths?.remove(at: (path?.startIndex)!)
              self.setRewardViewController(paths!)
              return true
          }
      }
  
      return FBSDKApplicationDelegate.sharedInstance().application(
          application,
          open: url,
          sourceApplication: sourceApplication,
          annotation: annotation)
  }
  </code></pre>
  
  <p>In short I have no Idea how to handle the dynamic link when app runs first time or run after killing the app?</p>