[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["\u003cbr /\u003e\n\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\nYou can have greater control over your Dynamic Links' branding by using your own\ndomain instead of a `page.link` subdomain. With custom domains, you can create\nDynamic Links like the following examples: \n\n```\nhttps://example.com/link-suffix\nhttps://example.com/links/promos/link-suffix\nhttps://links.example.com/link-suffix\nhttps://ex.amp.le/link-suffix\n```\n\nThe part of the URL before \u003cvar translate=\"no\"\u003elink-suffix\u003c/var\u003e is called the *URL prefix* ,\nand contains both your custom Dynamic Link domain and a path prefix. You will need to\nprovide a URL prefix when you create Dynamic Links.\n\nSetting up a custom domain requires Editor or Owner permission on your Firebase\nproject.\n| **Note:** To use a custom domain for Dynamic Links, the domain must point to Firebase Hosting. If you have a domain you want to use with Dynamic Links and the domain points to a different host, you can either move to Firebase Hosting or create a subdomain hosted by Firebase, which you can use for Dynamic Links.\n\nUsing your web domain for Dynamic Links\n\nYou can use the same domain for your Dynamic Links and your web pages, Universal\nLinks, and App Links, but if you do, you must take care that your Dynamic Link URLs\ndon't conflict with your web URLs. When you configure Dynamic Links to use a\nparticular URL prefix, all URLs that begin with that prefix are treated as\nDynamic Links, so you can't use URLs with that prefix to point to ordinary hosted\ncontent.\n\nFor example, if you want to create a Dynamic Link to the resource\n`https://example.com/my-resource` (a web page, Universal Link, or App Link), you\ncan't use `https://example.com/` as the Dynamic Links URL prefix, because doing so\nwould cause `https://example.com/my-resource` to be treated as a Dynamic Link.\nInstead, you must use a URL prefix with either a different domain or a different\npath prefix.\n\nSo, the following long-form Dynamic Links (and equivalent short links) won't work as\nintended because the URLs specified by the `link` parameter start with the\nDynamic Link URL prefix, `https://example.com/`: \n\n```\n https://example.com/?link=https://example.com/my-resource\n https://example.com/?link=https://example.com/resources/my-resource\n```\n\nBut the following long-form Dynamic Links (and equivalent short links) can work,\nbecause the URL prefixes don't conflict with the `link` URLs: \n\n```\n https://link.example.com/?link=https://example.com/my-resource\n https://example.com/links/?link=https://example.com/my-resource\n https://ex.amp.le/?link=https://example.com/my-resource\n```\n\nSet up a custom domain in the Firebase console\n\nYou can usually set up a custom domain completely in the Firebase console. To\ndo so:\n\n1. If you haven't set up Firebase Hosting for your project, open the\n [Hosting page](//console.firebase.google.com/project/_/hosting/) of the Firebase console, click\n **Get Started**, and click through the setup instructions. You don't have to\n complete the indicated steps at this time.\n\n2. Open the [Dynamic Links page](//console.firebase.google.com/project/_/durablelinks/) of the Firebase console.\n\n3. If you haven't used Dynamic Links before, click **Get Started** . Otherwise, click\n **Add URL prefix** from the drop-down menu.\n\n Then, complete the setup wizard, specifying the domain and path prefix you\n want to use when prompted.\n | **Note:** You can't use the same URL prefix for both Dynamic Links and regular hosting. If you want to use the same branding for both, consider using a path prefix (for example, example.com/links) or subdomain (links.example.com/) in your Dynamic Links URL prefix.\n4. **iOS only** : In your Xcode project's `Info.plist` file, create a key called\n `FirebaseDynamicLinksCustomDomains` and set it to your app's Dynamic Links URL\n prefixes. For example:\n\n \u003ckey\u003eFirebaseDynamicLinksCustomDomains\u003c/key\u003e\n \u003carray\u003e\n \u003cstring\u003ehttps://example.com/link\u003c/string\u003e\n \u003cstring\u003ehttps://example.com/promos\u003c/string\u003e\n \u003c/array\u003e\n\nSet up a custom domain manually\n\nIn some situations, such as when you already have a custom domain set up for\nDynamic Links and want to add another domain, or when you are adding a domain already\nconnected to a Hosting site, you have to set up your custom domain manually.\n\nTo do so:\n\n1. [Connect your domain to Firebase Hosting](/docs/hosting/custom-domain)\n if you haven't already done so.\n\n Setting up your domain with Firebase Hosting includes creating the\n configuration file [`firebase.json`](/docs/cli#the_firebasejson_file) in\n your local project directory.\n2. [Update to the latest version of the Firebase CLI](/docs/cli#update-cli)\n (v6.5.0 or later).\n\n3. Configure your Hosting site for Dynamic Links in your project's\n `firebase.json` file. If your project has multiple sites, be sure to\n configure the site connected to the domain you want to use.\n\n - Set `appAssociation` to `AUTO`. With this setting, Hosting\n dynamically generates `assetlinks.json` and `apple-app-site-association`\n files when they are requested.\n\n - Specify the path prefixes you want to use for Dynamic Links by setting rewrite\n rules with `dynamicLinks` set to `true`. Requests to these paths get\n proxied to Dynamic Links.\n\n Unlike rules that rewrite paths to URLs, Dynamic Link rewrite rules can't\n contain regular expressions.\n\n If you have multiple rewrite rules for your site, be aware that\n Hosting executes the first rewrite rule that matches the request.\n\n For example: \n\n \"hosting\": {\n // ...\n \"appAssociation\": \"AUTO\",\n \"rewrites\": [\n {\n \"source\": \"/promos/**\",\n \"dynamicLinks\": true\n },\n {\n \"source\": \"/links/share/**\",\n \"dynamicLinks\": true\n }\n ]\n }\n\n With the above configuration, you can create Dynamic Links with URL prefixes like\n the following examples: \n\n ```\n https://your-domain/promos/link-suffix\n https://your-domain/links/share/link-suffix\n ```\n\n \u003cbr /\u003e\n\n | **Note:** You can't use the same URL prefix for both Dynamic Links and regular hosting. If you want to use the same branding for both, consider using a path prefix (for example, example.com/links) or subdomain (links.example.com/) in your Dynamic Links URL prefix.\n\n If you use this domain only for Dynamic Links, you can use a source path of `/**`\n to create Dynamic Links with no path prefix: \n\n {\n \"source\": \"/**\",\n \"dynamicLinks\": true\n }\n\n With the above rule, you can create Dynamic Links like the following example: \n\n ```\n https://your-domain/link-suffix\n ```\n\n \u003cbr /\u003e\n\n4. Deploy your Hosting configuration changes:\n\n ```\n firebase deploy --only hosting\n ```\n\n \u003cbr /\u003e\n\n *(optional)* You can check the deployed `firebase.json` content using the\n [Hosting REST API](/docs/hosting/reference/rest/v1beta1/sites.releases/list?apix_params=%7B%22parent%22%3A%22sites%2F%3Cyour-site-name%3E%22%2C%22pageSize%22%3A1%7D).\n5. **iOS only** : In your Xcode project's `Info.plist` file, create a key called\n `FirebaseDynamicLinksCustomDomains` and set it to your app's Dynamic Links URL\n prefixes. For example:\n\n \u003ckey\u003eFirebaseDynamicLinksCustomDomains\u003c/key\u003e\n \u003carray\u003e\n \u003cstring\u003ehttps://example.com/promos\u003c/string\u003e\n \u003cstring\u003ehttps://example.com/links/share\u003c/string\u003e\n \u003c/array\u003e\n\nPriority order for Dynamic Links and Hosting\n\nFor Dynamic Links, be particularly aware of\n[hosting priority order](/docs/hosting/full-config#hosting_priority_order).\n\n- Ensure that your Dynamic Links URL prefix doesn't conflict with higher priority hosting configurations (for example, hosted static content always has priority over rewrites).\n- Within the `rewrites` attribute, the Hosting response will obey the rule specified by the *first `source` glob that captures the requested path*.\n\nFor example, if you set up a Dynamic Link for\n\u003cvar translate=\"no\"\u003eyour-domain\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003esource-path\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003elink-suffix\u003c/var\u003e\nbut you also have static content at\n\u003cvar translate=\"no\"\u003eyour-domain\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003esource-path\u003c/var\u003e`/index.html`, the\nstatic content takes precedence. An end-user will see `index.html` rather than\nthe Dynamic Link. Similarly, if you have static content at\n\u003cvar translate=\"no\"\u003eyour-domain\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003esource-path\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003elink-suffix\u003c/var\u003e,\nthe end-user will see the static content rather than the Dynamic Link.\n\nIf you want to use the same branding for both Dynamic Links and Hosting, consider\none of the following options for your Dynamic Links URL prefix:\n\n- Set your `source` attribute to match a path prefix. For example, if you have a\n custom domain of `example.com`, your rewrite rule could be:\n\n // Domain is example.com\n \"rewrites\": [ {\n \"source\": \"/links/**\", // Dynamic Links start with \"https://example.com/links/\"\n \"dynamicLinks\": true\n } ]\n\n- Set up a subdomain to use for Dynamic Links, then set your `source` attribute to\n match that subdomain. For example, if you have a subdomain of\n `links.example.com`, your rewrite rule could be:\n\n // Domain is links.example.com\n \"rewrites\": [ {\n \"source\": \"/**\", // Dynamic Links start with \"https://links.example.com/\"\n \"dynamicLinks\": true\n } ]\n\n| **Note:** You can check the deployed `firebase.json` content using the [Hosting REST API](/docs/hosting/reference/rest/v1beta1/sites.releases/list?apix_params=%7B%22parent%22%3A%22sites%2F%3Cyour-site-name%3E%22%2C%22pageSize%22%3A1%7D)."]]