使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Firebase Dynamic Links
plat_ios
plat_android
plat_web
plat_flutter
plat_cpp
plat_unity
Firebase Dynamic Links 是一种链接,可用于多种平台,无论用户是否已经安装了您的应用,这种链接都能按照您期望的方式工作。
利用 Dynamic Links,您的用户可以在他们打开您的链接的平台上获得最佳体验。如果用户在 iOS 或 Android 上打开一个 Dynamic Link,可以直接跳转到您的原生应用中的链接内容。如果用户在桌面浏览器中打开相同的 Dynamic Link,可以跳转到您网站上的同等内容。
此外,无论应用是否已安装,Dynamic Links 都可以工作:如果用户在 iOS 或 Android 上打开一个 Dynamic Link,但还没有安装您的应用,则可以提示该用户安装您的应用;安装后,您的应用就会启动并可以访问该链接。
工作原理
您可以通过以下方式创建 Dynamic Link:使用 Firebase 控制台;使用 REST API、iOS 或 Android Builder API;或者将 Dynamic Link 参数添加到应用专用的域名以生成网址。这些参数将会根据用户的平台以及是否安装了您的应用来指定您想要打开的链接。
当用户打开您的某个 Dynamic Links 时,如果他们尚未安装您的应用,系统会将其转到 Play 商店或 App Store(您也可以另行指定其他网站)来安装您的应用,安装之后该应用即会打开。然后,您就可以获取之前传递给您的应用的链接,并根据情况为您的应用适当处理该深层链接。
自定义链接网域
您可以使用自己的域名创建 Dynamic Links:
https://example.com/summer-sale
https://example.com/links/promos/summer-sale
https://links.example.com/summer-sale
https://ex.amp.le/summer-sale
如果您的应用没有网域,则可以使用免费的自定义 page.link 子网域:
https://example.page.link/summer-sale
您可以在 Firebase 控制台中免费创建子网域。
所有 Dynamic Links 功能,包括分析、安装后归因和 SDK 集成,都支持自定义 page.link 网域和您自己的网域。
实现流程
|
设置 Firebase 和 Dynamic Links SDK |
在 Firebase 控制台中为您的 Firebase 项目启用 Firebase Dynamic Links。然后,在您的应用中加入 Dynamic Links SDK。 |
|
创建 Dynamic Links |
您可以通过编程方式或使用 Firebase 控制台创建 Dynamic Links。 |
|
在您的应用中处理 Dynamic Links |
当您的应用打开时,使用 Dynamic Links SDK 检查是否有 Dynamic Link 传递给该应用。如果有传递的链接,可从 Dynamic Link 数据中获取深层链接,并根据需要对其进行处理。 |
|
查看分析数据 |
在 Firebase 控制台中跟踪 Dynamic Links 的效果。 |
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-18。
[null,null,["最后更新时间 (UTC):2025-08-18。"],[],[],null,["Firebase Dynamic Links \nplat_ios plat_android plat_web plat_flutter plat_cpp plat_unity \n\nFirebase Dynamic Links are links that work the way you want, on multiple\nplatforms, and whether or not your app is already installed. \n| **Deprecated:** Firebase Dynamic Links is *deprecated* and should not be adopted in projects that don't already use it. The service will shut down on August 25, 2025. See the [Dynamic Links Deprecation FAQ](/support/dynamic-links-faq) for more information.\n\nWith Dynamic Links, your users get the best available experience for the\nplatform they open your link on. If a user opens a Dynamic Link on iOS or Android,\nthey can be taken directly to the linked content in your native app. If a user\nopens the same Dynamic Link in a desktop browser, they can be taken to the equivalent\ncontent on your website.\n\nIn addition, Dynamic Links work across app installs: if a user opens a Dynamic Link on\niOS or Android and doesn't have your app installed, the user can be prompted to\ninstall it; then, after installation, your app starts and can access the link.\n\nHow does it work?\n\nYou create a Dynamic Link either by using the Firebase console, using a REST\nAPI, iOS or Android Builder API, or by forming a URL by adding Dynamic Link parameters to a domain\nspecific to your app. These parameters specify the links you want to open, depending on the\nuser's platform and whether your app is installed.\n\nWhen a user opens one of your Dynamic Links, if your app isn't yet installed, the\nuser is sent to the Play Store or App Store to install your app (unless you\nspecify otherwise), and your app opens. You can then retrieve the link that\nwas passed to your app and handle the deep link as appropriate for your app.\n\nCustom link domains\n\nYou can [create Dynamic Links using\nyour own domain name](/docs/dynamic-links/custom-domains): \n\n```\nhttps://example.com/summer-sale\nhttps://example.com/links/promos/summer-sale\nhttps://links.example.com/summer-sale\nhttps://ex.amp.le/summer-sale\n```\n\nOr, if you don't have a domain for your app, you can use a no-cost custom\npage.link subdomain: \n\n```\nhttps://example.page.link/summer-sale\n```\n\nCreate your subdomain at no charge in the Firebase console.\n\nAll Dynamic Links features, including analytics, post-install attributions, and\nSDK integrations, work with both custom page.link domains and your own\ndomain.\n\nImplementation path\n\n|---|-----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | **Set up Firebase and the Dynamic Links SDK** | Enable Firebase Dynamic Links for your Firebase project in the Firebase console. Then, include the Dynamic Links SDK in your app. |\n| | **Create Dynamic Links** | You can create Dynamic Links programmatically or by using the Firebase console. |\n| | **Handle Dynamic Links in your app** | When your app opens, use the Dynamic Links SDK to check if a Dynamic Link was passed to it. If so, get the deep link from the Dynamic Link data and handle the deep link as necessary. |\n| | **View analytics data** | Track the performance of your Dynamic Links in the Firebase console. |\n\nNext steps\n\n- Learn about some of Firebase Dynamic Links' most common [use cases](/docs/dynamic-links/use-cases) and how to implement them.\n- Learn how to [create\n Dynamic Links](/docs/dynamic-links/create-links) and then receive them in your [iOS](/docs/dynamic-links/ios/receive), [Android](/docs/dynamic-links/android/receive), [Flutter](/docs/dynamic-links/flutter/receive), [Unity](/docs/dynamic-links/unity/receive), and [C++](/docs/dynamic-links/cpp/receive) apps.\n- Use your own [custom\n domain](/docs/dynamic-links/custom-domains) for Dynamic Links.\n- Understand your Dynamic Links's performance with two [analytics](/docs/dynamic-links/analytics) tools."]]