تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يمكنك إنشاء Dynamic Links قصيرة أو طويلة باستخدام واجهة برمجة التطبيقات Firebase Dynamic Links. تتلقّى واجهة برمجة التطبيقات عدة بنى مَعلمات اختيارية لإنشاء الروابط. يمكن أيضًا إنشاء روابط مختصرة من رابط طويل تم إنشاؤه سابقًا. ستنشئ واجهة برمجة التطبيقات Dynamic Links عنوان URL على النحو التالي:
سجِّل مشروع Unity الخاص بك وأعدَّه لاستخدام Firebase.
إذا كان مشروع Unity يستخدم Firebase، يكون قد تم تسجيله وإعداده لاستخدام Firebase.
إذا لم يكن لديك مشروع Unity، يمكنك تنزيل تطبيق نموذجي.
أضِف FirebaseUnity SDK (تحديدًا FirebaseDynamicLinks.unitypackage) إلى مشروع Unity.
يُرجى العِلم أنّ إضافة Firebase إلى مشروع Unity يتضمّن مهامًا في كل من
وحدة تحكّم Firebase ومشروع Unity المفتوح (على سبيل المثال، يمكنك تنزيل ملفات إعداد Firebase من وحدة التحكّم، ثم نقلها إلى مشروع Unity).
ضبط بادئة Dynamic Links URI
في وحدة تحكّم Firebase، افتح القسم Dynamic Links.
إذا لم يسبق لك قبول بنود الخدمة وتحديد بادئة معرّف الموارد المنتظم (URI) Dynamic Links، عليك إجراء ذلك عند مطالبتك بذلك.
إذا كان لديك Dynamic Links بادئة معرّف الموارد المنتظم (URI)، سجِّلها. يجب تقديم بادئة معرّف الموارد المنتظم (URI) Dynamic Links عند إنشاء Dynamic Links آليًا.
إجراء مقترَح: حدِّد أنماط عناوين URL المسموح بها في الروابط لصفحات في التطبيق وروابط الاحتياط. سيؤدي ذلك إلى منع الجهات غير المصرَّح لها من إنشاء Dynamic Links تعيد التوجيه من نطاقك إلى مواقع إلكترونية لا تتحكّم فيها. راجِع مقالة السماح بأنماط عناوين URL محدّدة.
استخدام وحدة تحكّم Firebase
إذا أردت إنشاء Dynamic Link واحد، سواء لأغراض الاختبار أو ليتمكّن فريق التسويق من إنشاء رابط بسهولة يمكن استخدامه في منشور على وسائل التواصل الاجتماعي مثلاً، فإنّ أبسط طريقة هي الانتقال إلى وحدة تحكّم Firebase وإنشاء رمز يدويًا باتّباع النموذج المفصّل.
النطاقات الخاصة
يمكنك التحكّم بشكل أكبر في العلامة التجارية الخاصة بـ Dynamic Link من خلال استخدام نطاقك الخاص بدلاً من نطاق فرعي goo.gl أو page.link. اتّبِع هذه التعليمات لإعداد نطاق مخصّص لمشروعك.
استخدام واجهة برمجة التطبيقات Firebase Dynamic Links
إنشاء أغنية Dynamic Link طويلة من المَعلمات
لإنشاء رابط ديناميكي، أنشئ عنصر DynamicLinkComponents، واضبط أيًا من العناصر الاختيارية لإجراء إعدادات إضافية، ثمّ يمكنك الوصول إلى السمة LongDynamicLink للحصول على عنوان URL للرابط.
ينشئ المثال البسيط التالي رابطًا ديناميكيًا طويلاً يؤدي إلى
https://www.example.com/ ويفتح تطبيق Android
com.example.android على أجهزة Android والتطبيق com.example.ios على أجهزة iOS:
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
إنشاء فيديو Shorts Dynamic Link
لإنشاء رابط قصير من نوع Dynamic Link، مرِّر رابطًا طويلاً تم إنشاؤه سابقًا إلى
Firebase.DynamicLinks.GetShortLinkAsync أو أنشئ DynamicLinkComponents بالطريقة نفسها الموضّحة أعلاه.
تتضمّن السمة GetShortLinkAsync اختياريًا مَعلمة إعداد DynamicLinkOptions إضافية مع السمة PathLength، ما يتيح لك التحكّم في طريقة إنشاء الرابط. تتطلّب عملية إنشاء الروابط القصيرة إرسال طلب شبكة إلى الخلفية في 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.}});
يستخدم المثال أعلاه تعبير lambda يتم تشغيله عند اكتمال المهمة.
تاريخ التعديل الأخير: 2025-09-06 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-06 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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."]]