When opening dynamic links on my device, my function in SceneDelegate that handles dynamic links runs fine while the app is running in the background but not when the app is completely shut off. When I do click the dynamic link while the app is off, the app opens but the dynamic link is not handled. My scene delegate function looks like this:
SceneDelegate Function
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
guard let _ = (scene as? UIWindowScene) else { return }
if let incomingURL = userActivity.webpageURL {
print("Incoming URL is \(incomingURL)")
_ = DynamicLinks.dynamicLinks().handleUniversalLink(incomingURL) { (dynamicLink, error) in
guard error == nil else{
print("Found an error! \(error!.localizedDescription)")
return
}
if let dynamicLink = dynamicLink {
self.handleIncomingDynamicLink(dynamicLink)
}
}
}
}
any help understanding this issue is greatly appreciated!