I am using dynamic links and when the user installs an app through a dynamic link and opens first time I have implemented the below function in my scene delegate…
private func handleFirebaseDynamicLinksFromScheme(_ url: URL) {
guard let dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url) else {
print("Failed to retrieve dynamic link")
return
}
if dynamicLink.url != nil {
handleIncomingDynamicLink(dynamicLink)
} else {
print("Dynamic link is present but does not contain a URL: (dynamicLink)")
}
}
// Call for a launched app after download from AppleStore
func scene(_ scene: UIScene,
openURLContexts URLContexts: Set<UIOpenURLContext>) {
if let schemeURL = URLContexts.first?.url {
handleFirebaseDynamicLinksFromScheme(schemeURL)
print("handleFirebaseDynamicLinksFromScheme url = (schemeURL)")
}
}
but I am getting printed “Dynamic link is present but does not contain a URL” and in dynamic link URL is null. What can be the reason? because before it was working properly. and also other functions to get dynamic links and their URLs working properly (when the app is installed).