Di chuyển tính năng đăng nhập bằng đường liên kết trong email khỏi Đường liên kết động của Firebase (iOS)
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trước đây, tính năng xác thực bằng đường liên kết trong email dựa vào Firebase Dynamic Links. Tính năng này sẽ ngừng hoạt động vào ngày 25 tháng 8 năm 2025. Chúng tôi đã xuất bản một giải pháp thay thế trong Firebase Authentication iOS SDK phiên bản 11.8.0 trở lên. Nếu ứng dụng của bạn sử dụng Firebase Dynamic Links, bạn nên di chuyển ứng dụng của mình sang hệ thống mới dựa trên Firebase Hosting.
Di chuyển miền Firebase Dynamic Links được liên kết sang miền Firebase Hosting
Trong tương lai, thay vì sử dụng miền Firebase Dynamic Links, Firebase Authentication sẽ sử dụng miền mặc định Firebase Hosting cho dự án của bạn để tạo đường liên kết cho đường liên kết trong email và các hành động liên kết ngoài băng tần khác trong ứng dụng di động. Điều này có nghĩa là bạn cũng cần cập nhật ứng dụng để sử dụng miền mặc định này làm miền được liên kết cho các đường liên kết xác thực email đến ứng dụng di động của bạn.
Hãy làm theo hướng dẫn sau để xử lý các đường liên kết từ miền mới và hướng dẫn Firebase Authentication bắt đầu sử dụng miền Firebase Hosting để tạo các đường liên kết đến ứng dụng di động từ nay về sau.
Nếu bạn muốn tiếp tục sử dụng bất kỳ miền Firebase Hosting tuỳ chỉnh nào hoặc thậm chí miền Firebase Dynamic Links tuỳ chỉnh làm miền được liên kết mới, hãy làm theo hướng dẫn trong phần Tuỳ chỉnh đường liên kết trên thiết bị di động, điều chỉnh các bước cho phù hợp với miền mà bạn muốn sử dụng.
Liên kết miền Firebase Hosting với miền được liên kết của ứng dụng.
Bạn cần định cấu hình miền đã chọn làm Miền được liên kết cho đường liên kết đến ứng dụng. Để thiết lập quyền trong ứng dụng, hãy mở thẻ Signing & Capabilities (Ký và khả năng) của mục tiêu trong Xcode rồi thêm các miền Firebase Hosting từ bước trước vào khả năng Associated Domains (Miền được liên kết). Nếu sử dụng miền Firebase Hosting mặc định, thì giá trị này sẽ là applinks:PROJECT_ID.firebaseapp.com.
Một tệp miền được liên kết đã được triển khai trong tất cả các miền Firebase Hosting của bạn. Để truy cập vào phần này, hãy chuyển đến PROJECT_ID.firebaseapp.com/.well-known/apple-app-site-association.
Bạn có thể ghi đè tệp AASA này; hãy xem phần Tạo và lưu trữ tệp cấu hình Đường liên kết phổ quát để biết thêm thông tin.
Định cấu hình dự án để sử dụng các đường liên kết mới.
Khi đã sẵn sàng xử lý các đường liên kết đến miền mới, bạn có thể sử dụng Firebase Admin SDK để cập nhật cách bạn muốn tạo đường liên kết qua email và hướng dẫn hệ thống phụ trợ của chúng tôi bắt đầu tạo đường liên kết bằng miền Firebase Hosting mới.
constupdateRequest={mobileLinksConfig:{domain:'HOSTING_DOMAIN'}}constupdateProjectConfig=()=>{projectConfigManager.updateProjectConfig(updateRequest).then((response)=>{// updated project config}).catch((error)=>{console.log('Error updating the project:',error);});}
Gửi và đổi đường liên kết trong email.
Gửi đường liên kết đăng nhập bằng email như trước đây. Khi người dùng cuối nhấp vào đường liên kết, họ sẽ được chuyển hướng đến ứng dụng (nếu đã cài đặt) để hoàn tất quy trình đăng nhập.
Tuỳ chỉnh đường liên kết trên thiết bị di động
Bạn có thể sử dụng miền Firebase Hosting tuỳ chỉnh hoặc sử dụng lại miền Firebase Dynamic Links tuỳ chỉnh để làm miền mới cho đường liên kết đến thiết bị di động.
Bạn có thể sử dụng lại bất kỳ miền Firebase Dynamic Links nào của mình làm miền tuỳ chỉnh. Tuy nhiên, mọi chức năng Firebase Dynamic Links sẽ không còn được hỗ trợ (ví dụ: người dùng không thể được chuyển hướng đến cửa hàng ứng dụng nếu ứng dụng chưa được cài đặt trên thiết bị của họ).
[null,null,["Cập nhật lần gần đây nhất: 2025-08-16 UTC."],[],[],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 iOS SDK version 11.8.0+. If your\napp uses Firebase Dynamic Links, you should migrate your app to the new\nFirebase Hosting based system.\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 on Apple Platforms](/docs/auth/ios/email-link-auth)\nto update your app to use the new automatically provisioned Firebase Hosting\ndefault domain.\n\nUse the following instructions to handle links from the new domain and to\ninstruct Firebase Authentication to start using the Firebase Hosting domain to\ngenerate mobile app links 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 domain,\nusing the instructions in the [Customize Mobile Links](#customize-mobile-links)\nsection, adapt the steps to match the intended domain you'd like to use.\n\n1. **Link Firebase Hosting domain to your app associated domain.**\n\n You'll need to configure the selected domain as an Associated Domain for\n app links. To set up the entitlement in your app, open the target's\n **Signing \\& Capabilities** tab in Xcode and add Firebase Hosting domains\n from the previous step to the Associated Domains capability. If using the\n default Firebase Hosting domain, this will be\n `applinks:`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`.firebaseapp.com`.\n\n See [Supporting associated domains](https://developer.apple.com/documentation/xcode/supporting-associated-domains)\n on Apple's documentation site for more information.\n\n An associated domain file has been deployed under all your\n Firebase Hosting domains. To access it, navigate to\n \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`.firebaseapp.com/.well-known/apple-app-site-association`.\n This AASA file can be overwritten; see\n [Create and host your Universal Links configuration files](/support/guides/app-links-universal-links#create_and_host_your_universal_links_configuration_files_on_your_new_hosting_domain)\n for more information.\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 the\n 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 an end user clicks on the link,\n they will be redirected to the app if installed to finish 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. Link the custom domain to your app associated domain.\n3. [Send an authentication link to the user's email address](/docs/auth/ios/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 the app store if app isn't installed on their device).\n2. [Send an authentication link to the user's email address](/docs/auth/ios/email-link-auth#send_an_authentication_link_to_the_users_email_address) with an updated `ActionCodeSettings` object with a custom domain as `linkDomain`."]]