انتقال پیوند ایمیل به سیستم به دور از Firebase Dynamic Links (اندروید)
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
احراز هویت پیوند ایمیل قبلاً به Firebase Dynamic Links متکی بود که در 25 آگوست 2025 بسته خواهد شد. ما یک راه حل جایگزین را در Firebase Authentication Android SDK نسخه 23.2.0+ و Firebase BoM نسخه 33.9.0+ منتشر کرده ایم. اگر برنامه شما از پیوندهای سبک قدیمی استفاده می کند و می خواهید از یک روش جایگزین برای انتقال برنامه خود استفاده کنید، برای استفاده از سیستم جدید مبتنی بر Firebase Hostingبه احراز هویت با Firebase با استفاده از Email Link در اندروید مراجعه کنید.
همچنین، اگر از Firebase Authentication Android SDK زیر نسخه 20.0.0 (یا Firebase BoM زیر نسخه 26.0.0) برای مدیریت جریانهای OAuth با Firebase Authentication استفاده میکنید، باید به آخرین نسخه Authentication SDK یا BoM ( Authentication v.2+ v.6 یا به ترتیب BoM به ترتیب ادامه دهید. مدیریت جریان های OAuth در Firebase Authentication .
دامنه Firebase Dynamic Links مرتبط خود را به دامنه Firebase Hosting منتقل کنید
بهجای استفاده از دامنه Firebase Dynamic Links ، Firebase Authentication از دامنه پیشفرض Firebase Hosting برای پروژه شما برای ایجاد پیوندهایی برای پیوند ایمیل و سایر اقدامات پیوند خارج از باند در برنامههای تلفن همراه استفاده میکند. این بدان معناست که برنامه شما نیز برای استفاده از این دامنه پیشفرض به عنوان دامنه مرتبط برای پیوندهای احراز هویت ایمیل به برنامه تلفن همراه شما، باید بهروزرسانی شود.
میتوانید دستورالعملهای موجود در Authenticate with Firebase با استفاده از Email Link در Android را دنبال کنید تا پیوندهای برنامه تلفن همراه خود را برای استفاده از دامنه پیشفرض Firebase Hosting جدید که بهطور خودکار ارائه میشود، بهروزرسانی کنید.
از دستورالعملهای زیر برای مدیریت پیوندها از دامنه جدید استفاده کنید و به Firebase Authentication دستور دهید تا از دامنه جدید برای ایجاد پیوندهای برنامه تلفن همراه در آینده استفاده کند.
اگر می خواهید به استفاده از هر یک از دامنه های Firebase Hosting سفارشی خود یا حتی دامنه Firebase Dynamic Links سفارشی خود ادامه دهید تا دامنه جدید مرتبط شما باشد، مراحلی را دنبال کنید که با دامنه مورد نظری که می خواهید استفاده کنید مطابقت دارد. توجه داشته باشید که پس از تکمیل دستورالعملهای بخش زیر، ویژگی پیوند عمیق در دامنه سفارشی Firebase Dynamic Links شما حذف خواهد شد. فقط خود دامنه برای ایجاد پیوندهای ایمیل باقی می ماند.
برنامه اندروید خود را برای مدیریت لینک Firebase Hosting پیکربندی کنید
برای مدیریت این پیوندها از برنامه Android خود، نام بسته برنامه شما باید در تنظیمات پروژه کنسول Firebase مشخص شود. علاوه بر این، SHA-1 و SHA-256 گواهی درخواست باید ارائه شود.
اگر میخواهید این پیوندهای Firebase Hosting به یک فعالیت خاص هدایت شوند، باید یک فیلتر هدف را در فایل AndroidManifest.xml خود پیکربندی کنید. فیلتر قصد باید پیوندهای Firebase Hosting دامنه شما را بگیرد. در AndroidManifest.xml :
وقتی کاربران پیوند میزبانی را با مسیر "/__/auth/links" و طرح و میزبانی که مشخص کردهاید باز میکنند، برنامه شما فعالیت را با این فیلتر قصد شروع میکند تا پیوند را مدیریت کند.
پروژه خود را برای استفاده از پیوندهای جدید پیکربندی کنید
هنگامی که برای مدیریت پیوندهای دامنه جدید آماده شدید، می توانید از Firebase Admin SDK برای به روز رسانی نحوه ایجاد پیوندهای ایمیل استفاده کنید و به پشتیبان ما دستور دهید تا با استفاده از دامنه Firebase Hosting جدید شروع به تولید پیوندها کند.
import{getAuth}from'firebase-admin/auth';constupdateEmailAuthDomain=async()=>{constupdateRequest={mobileLinksConfig:{domain:'HOSTING_DOMAIN',},};constprojectConfigManager=getAuth().projectConfigManager();try{constresponse=awaitprojectConfigManager.updateProjectConfig(updateRequest);// Updated project configconsole.log('Project configuration updated successfully:',response);}catch(error){console.error('Error updating the project:',error);}};
پیوند ایمیل را ارسال و بازخرید کنید
لینک ورود به ایمیل را مانند قبل ارسال کنید. هنگامی که کاربر نهایی روی پیوند کلیک می کند، در صورت نصب برای تکمیل ورود به برنامه به برنامه هدایت می شود.
لینک های موبایل خود را سفارشی کنید
می توانید از دامنه Firebase Hosting سفارشی استفاده کنید یا از دامنه Firebase Dynamic Links سفارشی خود مجدداً به عنوان دامنه پیوندهای تلفن همراه جدید خود استفاده کنید.
از دامنه Firebase Dynamic Links سفارشی خود دوباره استفاده کنید
میتوانید از هر یک از دامنههای Firebase Dynamic Links خود به عنوان دامنه سفارشی خود استفاده کنید. با این حال، دیگر قابلیت Firebase Dynamic Links پشتیبانی نمیشود (به عنوان مثال، اگر برنامه روی دستگاهشان نصب نشده باشد، کاربران نمیتوانند به فروشگاه برنامه هدایت شوند).
برنامه اندروید خود را برای مدیریت لینک Firebase Hosting خود پیکربندی کنید (دستورالعمل های بخش قبلی در بالا).
تاریخ آخرین بهروزرسانی 2025-08-28 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-28 بهوقت ساعت هماهنگ جهانی."],[],[],null,["Email link authentication previously relied on Firebase Dynamic Links, which will be\n[shut down on August 25, 2025](/support/dynamic-links-faq). We've published an\nalternative solution in the Firebase Authentication Android SDK version 23.2.0+ and\nFirebase BoM version 33.9.0+. If your app uses the old style links and you\nwant to use an alternative method for migrating your app, see\n[Authenticate with Firebase using Email Link in Android](/docs/auth/android/email-link-auth)\nto use the new Firebase Hosting based system.\n\nAlso, if you're using the **Firebase Authentication Android SDK below v20.0.0 (or the\nFirebase BoM below v26.0.0) to manage OAuth flows** with Firebase Authentication,\nyou'll need to update to the latest Authentication SDK or BoM version\n(Authentication v20.0.0+ or BoM v26.0.0+) in order to continue managing OAuth\nflows in Firebase Authentication.\n\nMigrate your associated Firebase Dynamic Links domain to a Firebase Hosting domain\n\nMoving forward, rather than using a Firebase Dynamic Links domain, Firebase Authentication\nwill use the Firebase Hosting default domain for your project to create\nlinks for email link and other out-of-band link actions in mobile apps. This\nmeans that your app will also need to be updated to use this default domain as\nthe associated domain for email authentication links to your mobile app.\n\nYou can follow the instructions in\n[Authenticate with Firebase Using Email Link in Android](/docs/auth/android/email-link-auth) to update your mobile app links\nto use the new automatically provisioned Firebase Hosting default domain.\n\nUse the following instructions to handle links from the new domain and to\ninstruct Firebase Authentication to start using the new domain to generate mobile app\nlinks going forward.\n\nIf you'd like to continue using any of your custom Firebase Hosting domains\nor even your custom Firebase Dynamic Links domain to be your new associated\ndomain, follow the steps that match the intended domain you'd like to use. Note\nthat after completing the instructions in the following section, the deep\nlinking feature on your Firebase Dynamic Links custom domain will be removed;\nonly the domain itself will remain for creating email links.\n\n1. **Configure your Android application to handle your Firebase Hosting link**\n\n 1. In order to handle these links from your Android application, your app's package name needs to be specified in the Firebase console project settings. In addition, the SHA-1 and SHA-256 of the application certificate need to be provided.\n 2. If you want these Firebase Hosting links to redirect to a specific\n activity, you will need to configure an intent filter in your\n `AndroidManifest.xml` file. The intent filter should catch\n Firebase Hosting links of your domain. In `AndroidManifest.xml`:\n\n \u003cintent-filter android:autoVerify=\"true\"\u003e\n \u003caction android:name=\"android.intent.action.VIEW\" /\u003e\n \u003ccategory android:name=\"android.intent.category.BROWSABLE\" /\u003e\n \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n \u003cdata\n android:scheme=\"https\"\n android:host=\"PROJECT_ID.firebaseapp.com or a custom hosting domain\"\n android:pathPrefix=\"/__/auth/links\" /\u003e\n \u003c/intent-filter\u003e\n\n When users open a hosting link with the \"/__/auth/links\" path and the\n scheme and host you specify, your app will start the activity with this\n intent filter to handle the link.\n | **Important:** To ensure a seamless rollback, we recommend keeping your existing intent filter that handles Firebase Dynamic Links while trying out the Firebase Hosting link solution. The Firebase Dynamic Links solution will be available until August 25, 2025.\n2. **Configure your project to use the new links**\n\n When you're ready to handle the new domain links, you can use the\n [Firebase Admin SDK](/docs/admin/setup) to update how you want email links\n to be generated and instruct our backend to start generating links using\n the new Firebase Hosting domain. \n\n const updateRequest = {\n mobileLinksConfig: {\n domain: 'HOSTING_DOMAIN'\n }\n }\n const updateProjectConfig = () =\u003e {\n projectConfigManager.updateProjectConfig(updateRequest)\n .then((response) =\u003e {\n // updated project config\n }).catch((error) =\u003e {\n console.log('Error updating the project:', error);\n });\n }\n\n | **Important:** To rollback to the Firebase Dynamic Links while implementing and testing the backup solution, you should set the domain back to `FIREBASE_DYNAMIC_LINK`. The Firebase Dynamic Links solution will be available until August 25, 2025.\n3. **Send and redeem the email link**\n\n Send the email sign-in link as before. When the end user clicks the link,\n they will be redirected to the app if installed to complete the sign-in.\n\nCustomize your mobile links\n\nYou can use a custom Firebase Hosting domain or reuse your custom\nFirebase Dynamic Links domain to be your new mobile links domain.\n\nUse a custom Firebase Hosting domain\n\n1. Follow the [Firebase Hosting guide](/docs/hosting/custom-domain) to set up a custom domain.\n2. Configure your Android application to handle your Firebase Hosting link. (instructions in previous section above).\n3. [Send an authentication link to the user's email\n address](/docs/auth/android/email-link-auth#send_an_authentication_link_to_the_users_email_address) with an updated `ActionCodeSettings` object with a custom domain as `linkDomain`.\n\nRe-use your custom Firebase Dynamic Links domain\n\n1. You can re-use any of your Firebase Dynamic Links domains as your custom domain. However, any Firebase Dynamic Links functionality will no longer be supported (for example, users cannot be redirected to an app store if the app isn't installed on their device).\n2. Configure your Android application to handle your Firebase Hosting link (instructions in previous section above).\n3. [Send an authentication link to the user's email\n address](/docs/auth/android/email-link-auth#send_an_authentication_link_to_the_users_email_address) with an updated `ActionCodeSettings` object with a custom domain as `linkDomain`."]]