了解动态链接 Firebase

Understand Dynamic Links Firebase

我想更好地了解 Firebase 动态链接,因为我对这个主题还很陌生。

我想知道的:

我的用例非常简单,我试图通过我的应用程序中的消息共享一个对象,所以我想在我的数据库中保存动态 link 并能够将其读取到 运行 根据具体参数查询

  1. FirebaseDynamicLinks.instance.getInitialLink() returns 打开应用程序的 link 如果应用程序不是由动态 link 打开的,那么它将return 空。

    Future<PendingDynamicLinkData?> getInitialLink()

    Attempts to retrieve the dynamic link which launched the app.

    This method always returns a Future. That Future completes to null if there is no pending dynamic link or any call to this method after the the first attempt.

    https://pub.dev/documentation/firebase_dynamic_links/latest/firebase_dynamic_links/FirebaseDynamicLinks/getInitialLink.html

  2. FirebaseDynamicLinks.instance.getInitialLink() 不接受字符串 url 作为参数,因为它仅用于 return 打开应用程序的 link。

  3. 似乎没有直接的答案来从缩短的 link 中取回查询参数。看看这个 discussion 看看是否有任何解决方法适合您的用例。