swiftpdfimportios-sharesheet

How do I access The URL shared over an Activity Sheet in iOs


I am trying to import a PDF to my App through Safari via activity sheet. My app pops up on the activity sheet but I cannot access the URL. I have tried using the application(_:open:options:) function in my app delegate but it's not working url handling function

func application(_ app: UIApplication,
   open url: URL,
   options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool{

    print(url)
    return true
}

Solution

  • I found the solution here Using Scene Delegate Functions To Receive Urls

    func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
    print(URLContexts.debugDescription)
    

    }