Firebase Dynamic Links API를 사용하여 짧거나 긴 Dynamic Links를 만들 수 있습니다. 이 API는 여러 개의 선택적 매개변수 구조체를 취하여 링크를 작성합니다. 이전에 생성한 긴 링크로부터 짧은 링크를 만들 수도 있습니다. Dynamic Links API는 다음과 같은 URL을 생성합니다.
FirebaseUnity SDK(특히 FirebaseDynamicLinks.unitypackage)를 Unity 프로젝트에 추가합니다.
Unity 프로젝트에 Firebase를 추가할 때 Firebase Console 및 열려 있는 Unity 프로젝트 모두에서 작업을 수행해야 합니다. 예를 들어 Console에서 Firebase 구성 파일을 다운로드한 후 이 파일을 Unity 프로젝트로 이동하는 작업이 필요합니다.
Dynamic Links URI 프리픽스 설정
Firebase 콘솔에서 Dynamic Links 섹션을 엽니다.
아직 서비스 약관에 동의하지 않았고 Dynamic Links의 URI 프리픽스도 설정하지 않았다면 관련 메시지가 표시될 때 동의하고 설정합니다.
Dynamic Links URI 프리픽스가 이미 있다면 기록해 둡니다. 프로그래매틱 방식으로 Dynamic Links를 만들 때 Dynamic Links URI 프리픽스를 제공해야 합니다.
권장: 딥 링크 및 대체 링크에 허용되는 URL 패턴을 지정합니다. 이렇게 하면 승인되지 않은 사용자가 내 도메인에서 내가 제어하지 않는 사이트로 리디렉션되는 Dynamic Links를 만드는 것을 막을 수 있습니다. 특정 URL 패턴 허용을 참조하세요.
Firebase Console 사용
테스트에 사용하거나 마케팅팀에서 소셜 미디어 게시물 등에 사용할 수 있는 링크를 간편하게 만들 수 있도록 Dynamic Link 하나를 생성하려고 할 때 가장 간단한 방법은 Firebase 콘솔로 이동하여 단계별 양식에 따라 직접 만드는 것입니다.
커스텀 도메인
goo.gl 또는 page.link 하위 도메인 대신 자체 도메인을 사용하여 Dynamic Link 브랜딩을 보다 세부적으로 관리할 수 있습니다. 다음 안내에 따라 프로젝트의 커스텀 도메인을 설정하세요.
Firebase Dynamic Links API 사용
매개변수로 긴 Dynamic Link 만들기
동적 링크를 만들려면 DynamicLinkComponents 객체를 만들고 추가 구성을 위한 선택적 멤버를 설정한 후 LongDynamicLink에 액세스하여 링크 URL을 가져옵니다.
다음은 Android 앱 com.example.android 및 iOS 앱 com.example.ios에서 https://www.example.com/을 여는 긴 동적 링크를 만드는 간단한 예시입니다.
varcomponents=newFirebase.DynamicLinks.DynamicLinkComponents(// The base Link.newSystem.Uri("https://www.example.com/"),// The dynamic link URI prefix."https://example.page.link"){IOSParameters=newFirebase.DynamicLinks.IOSParameters("com.example.ios"),AndroidParameters=newFirebase.DynamicLinks.AndroidParameters("com.example.android.package_name"),};// do something with: components.LongDynamicLink
짧은 Dynamic Link 만들기
짧은 동적 링크를 만들려면 이전에 생성한 긴 링크를 Firebase.DynamicLinks.GetShortLinkAsync에 전달하거나 위와 동일한 방법으로 DynamicLinkComponents를 작성합니다.
GetShortLinkAsync는 PathLength 속성을 갖는 DynamicLinkOptions 구성 파라미터를 선택적으로 취하며, 이를 통해 링크 생성 방법을 제어할 수 있습니다. 짧은 링크를 생성하려면 Firebase 백엔드에 대한 네트워크 요청이 필요하므로 GetShortLinkAsync 메서드는 비동기식으로 실행됩니다.
GetShortLinkAsync에서 Task<Firebase.DynamicLinks.ShortDynamicLink>를 반환합니다.
예를 들면 다음과 같습니다.
varoptions=newFirebase.DynamicLinks.DynamicLinkOptions{PathLength=DynamicLinkPathLength.Unguessable};Firebase.DynamicLinks.DynamicLinks.GetShortLinkAsync(components,options).ContinueWith(task=>{if(task.IsCanceled){Debug.LogError("GetShortLinkAsync was canceled.");return;}if(task.IsFaulted){Debug.LogError("GetShortLinkAsync encountered an error: "+task.Exception);return;}// Short Link has been created.Firebase.DynamicLinks.ShortDynamicLinklink=task.Result;Debug.LogFormat("Generated short link {0}",link.Url);varwarnings=newSystem.Collections.Generic.List<string>(link.Warnings);if(warnings.Count > 0){// Debug logging for warnings generating the short link.}});
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-01(UTC)"],[],[],null,["\u003cbr /\u003e\n\n| **Note:** Firebase Dynamic Links is *deprecated* and should not be used in new projects. The service will be shutting down soon. Follow the [migration guide](/support/dynamic-links-faq#how_should_i_migrate_from_the_service) and see the [Dynamic Links Deprecation FAQ](/support/dynamic-links-faq) for more information.\n\nYou can create short or long Dynamic Links with the Firebase Dynamic Links API. The API\ntakes several optional parameter structures to build links. Short links can\nalso be created from a previously generated long link. The Dynamic Links API\nwill generate a URL like the following: \n\n https://example.page.link/aSDf\n\nBefore you begin\n\nBefore you can use\n[Firebase Dynamic Links](/docs/reference/unity/namespace/firebase/dynamic-links),\nyou need to:\n\n- Register your Unity project and configure it to use Firebase.\n\n - If your Unity project already uses Firebase, then it's already\n registered and configured for Firebase.\n\n - If you don't have a Unity project, you can download a\n [sample app](//github.com/google/mechahamster).\n\n- Add the [Firebase Unity SDK](/download/unity) (specifically, `FirebaseDynamicLinks.unitypackage`) to\n your Unity project.\n\n| **Find detailed instructions for these initial\n| setup tasks in\n| [Add Firebase to your Unity project](/docs/unity/setup#prerequisites).**\n\nNote that adding Firebase to your Unity project involves tasks both in the\n[Firebase console](//console.firebase.google.com/) and in your open Unity project\n(for example, you download Firebase config files from the console, then move\nthem into your Unity project).\n| **Note:** Dynamic Links is not supported on tvOS.\n\nSet a Dynamic Links URI prefix\n\n1. In the Firebase console, open the **Dynamic Links** section.\n\n2. If you have not already accepted the terms of service and set a URI prefix for\n your Dynamic Links, do so when prompted.\n\n If you already have a Dynamic Links URI prefix, take note of it. You need to\n provide a Dynamic Links URI prefix when you programmatically create Dynamic Links.\n\n3. **Recommended** : Specify the URL patterns allowed in your deep links and\n fallback links. By doing so, you prevent unauthorized parties from\n creating Dynamic Links that redirect from your domain to sites you don't\n control. See\n [Allow specific URL patterns](/docs/dynamic-links/allow-specific-url-patterns).\n\nUse the Firebase console\n\nIf you want to generate a single Dynamic Link, either for testing purposes, or for your marketing team\nto easily create a link that can be used in something like a social media post, the simplest way would\nbe to visit the [Firebase console](https://console.firebase.google.com/project/_/durablelinks/links/)\nand create one manually following the step-by-step form.\n\nCustom domains\n\nYou can have greater control over your Dynamic Link's branding by using your own\ndomain instead of a `goo.gl` or `page.link` subdomain. Follow [these\ninstructions](/docs/dynamic-links/custom-domains) to set up a custom domain for\nyour project.\n| **Note:** If you're building your project for iOS, you must edit the `Info.plist` file per the [iOS-only instructions](/docs/dynamic-links/custom-domains#console) for setting up a custom domain.\n\nUsing the Firebase Dynamic Links API\n\nCreating a long Dynamic Link from parameters\n\nTo create a Dynamic Link, create a `DynamicLinkComponents` object, setting any\nof the optional members for additional configuration, and then access the\n`LongDynamicLink` property to get the link URL.\n\nThe following minimal example creates a long Dynamic Link to\nhttps://www.example.com/ that opens with your Android app\ncom.example.android on Android and the app com.example.ios on iOS: \n\n```c#\nvar components = new Firebase.DynamicLinks.DynamicLinkComponents(\n // The base Link.\n new System.Uri(\"https://www.example.com/\"),\n // The dynamic link URI prefix.\n \"https://example.page.link\") {\n IOSParameters = new Firebase.DynamicLinks.IOSParameters(\"com.example.ios\"),\n AndroidParameters = new Firebase.DynamicLinks.AndroidParameters(\n \"com.example.android.package_name\"),\n };\n// do something with: components.LongDynamicLink\n```\n| **Note:** Long links append all of the configuration settings as query arguments to the link and therefore do not require any network calls.\n\nCreating a short Dynamic Link\n\nTo create a short Dynamic Link, pass a previously generated long link to\n`Firebase.DynamicLinks.GetShortLinkAsync` or build `DynamicLinkComponents` in\nthe same way as above.\n\n`GetShortLinkAsync` optionally takes an extra `DynamicLinkOptions` config\nparameter with the `PathLength` property, allowing you to control how the link\nshould be generated. Short link generation requires a network request to the\nFirebase backend, so the `GetShortLinkAsync` method is executed asynchronously.\n`GetShortLinkAsync` returns a `Task\u003cFirebase.DynamicLinks.ShortDynamicLink\u003e`.\n\nFor example: \n\n```c#\nvar options = new Firebase.DynamicLinks.DynamicLinkOptions {\n PathLength = DynamicLinkPathLength.Unguessable\n};\n\nFirebase.DynamicLinks.DynamicLinks.GetShortLinkAsync(components, options).ContinueWith(task =\u003e {\n if (task.IsCanceled) {\n Debug.LogError(\"GetShortLinkAsync was canceled.\");\n return;\n }\n if (task.IsFaulted) {\n Debug.LogError(\"GetShortLinkAsync encountered an error: \" + task.Exception);\n return;\n }\n\n // Short Link has been created.\n Firebase.DynamicLinks.ShortDynamicLink link = task.Result;\n Debug.LogFormat(\"Generated short link {0}\", link.Url);\n\n var warnings = new System.Collections.Generic.List\u003cstring\u003e(link.Warnings);\n if (warnings.Count \u003e 0) {\n // Debug logging for warnings generating the short link.\n }\n});\n```\n\nThe example above uses a lambda expression that is triggered when the task is\ncompleted."]]