单击Firebase动态链接后-DynamicLinks.dynamicLinks().handleUniversalLink返回false [英] Upon clicking Firebase dynamic link - DynamicLinks.dynamicLinks().handleUniversalLink returns false
问题描述
我正在使用Firebase动态链接,而在Firebase控制台中创建的链接却很少.
I am using Firebase dynamic links and I have few links that I have created in the firebase console.
以下是示例短链接,我将其复制粘贴到电子邮件中并单击: https://app.xxx.com/deeplink/xyz
Here is example short link that I copy pasted to an email and clicking: https://app.xxx.com/deeplink/xyz
当我们单击提供的链接时,将调用以下函数:
When we click on the link provided, the following function gets called:
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { }
我尝试使用以下代码捕获动态链接,并且该链接始终返回false,并且从未执行完成块:
I have tried capturing the dynamic link with following code and it always returns false and completion block was never executed:
let handled = DynamicLinks.dynamicLinks().handleUniversalLink(userActivity.webpageURL!) { dynamiclink, error in
print("dyn:: ------- \(dynamiclink?.url)")
}
我尝试在此处引用类似的问题,以下是一些链接: 1. https://github.com/firebase/quickstart-ios/issues/380 2. Firebase动态链接-Continueuseractivity不返回动态链接url
I have tried referring to similar issues here, here are few links: 1. https://github.com/firebase/quickstart-ios/issues/380 2. Firebase dynamic linking - Continueuseractivity not returning dynamic link url
但是他们都不起作用.这是我在日志中看到的错误: 深层链接Web URL查询为空
But none of them worked. And this is the error I could see in the logs: Deep Link Web URL query is empty
PS:我正在使用Firebase动态链接版本-4.0.1
PS: I am using Firebase Dynamic Links version - 4.0.1
推荐答案
我忘记在Info.plist中设置FirebaseDynamicLinksCustomDomains.设置完成后,它便开始工作
I forgot to setup FirebaseDynamicLinksCustomDomains in Info.plist. Once that has been set, it started working
这篇关于单击Firebase动态链接后-DynamicLinks.dynamicLinks().handleUniversalLink返回false的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!