Migrer la connexion par lien e-mail depuis Firebase Dynamic Links (iOS)
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
L'authentification par lien envoyé par e-mail reposait auparavant sur Firebase Dynamic Links, qui sera désactivé le 25 août 2025. Nous avons publié une solution alternative dans la version 11.8.0 ou ultérieure du SDK iOS Firebase Authentication. Si votre application utilise Firebase Dynamic Links, vous devez la migrer vers le nouveau système Firebase Hosting.
Migrer votre domaine Firebase Dynamic Links associé vers un domaine Firebase Hosting
À l'avenir, au lieu d'utiliser un domaine Firebase Dynamic Links, Firebase Authentication utilisera le domaine par défaut Firebase Hosting pour votre projet afin de créer des liens pour les actions de lien par e-mail et autres actions de lien hors bande dans les applications mobiles. Cela signifie que vous devrez également mettre à jour votre application pour qu'elle utilise ce domaine par défaut comme domaine associé pour les liens d'authentification par e-mail vers votre application mobile.
Suivez les instructions ci-dessous pour gérer les liens du nouveau domaine et indiquer à Firebase Authentication de commencer à utiliser le domaine Firebase Hosting pour générer des liens vers des applications mobiles à l'avenir.
Si vous souhaitez continuer à utiliser l'un de vos domaines Firebase Hosting personnalisés ou même votre domaine Firebase Dynamic Links personnalisé comme nouveau domaine associé, suivez les instructions de la section Personnaliser les liens mobiles en adaptant les étapes au domaine que vous souhaitez utiliser.
Associez le domaine Firebase Hosting au domaine associé à votre application.
Vous devrez configurer le domaine sélectionné en tant que domaine associé pour les liens d'application. Pour configurer le droit d'accès dans votre application, ouvrez l'onglet Signature et capacités de la cible dans Xcode, puis ajoutez les domaines Firebase Hosting de l'étape précédente à la capacité "Domaines associés". Si vous utilisez le domaine Firebase Hosting par défaut, la valeur sera applinks:PROJECT_ID.firebaseapp.com.
Un fichier de domaine associé a été déployé sous tous vos domaines Firebase Hosting. Pour y accéder, accédez à PROJECT_ID.firebaseapp.com/.well-known/apple-app-site-association.
Ce fichier AASA peut être remplacé. Pour en savoir plus, consultez Créer et héberger vos fichiers de configuration Universal Links.
Configurez votre projet pour qu'il utilise les nouveaux liens.
Lorsque vous serez prêt à gérer les nouveaux liens de domaine, vous pourrez utiliser le SDK Admin Firebase pour indiquer comment vous souhaitez que les liens de messagerie soient générés et demander à notre backend de commencer à générer des liens à l'aide du nouveau domaine 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);}};
Envoyez et utilisez le lien de l'e-mail.
Envoyez le lien de connexion par e-mail comme d'habitude. Lorsqu'un utilisateur final clique sur le lien, il est redirigé vers l'application (si elle est installée) pour terminer la connexion.
Personnaliser vos liens pour mobile
Vous pouvez utiliser un domaine Firebase Hosting personnalisé ou réutiliser votre domaine Firebase Dynamic Links personnalisé comme nouveau domaine pour les liens mobiles.
Vous pouvez réutiliser l'un de vos domaines Firebase Dynamic Links comme domaine personnalisé. Toutefois, les fonctionnalités Firebase Dynamic Links ne seront plus prises en charge (par exemple, les utilisateurs ne pourront pas être redirigés vers l'App Store si l'application n'est pas installée sur leur appareil).
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/05 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/05 (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 import { getAuth } from 'firebase-admin/auth';\n\n const updateEmailAuthDomain = async () =\u003e {\n const updateRequest = {\n mobileLinksConfig: {\n domain: 'HOSTING_DOMAIN',\n },\n };\n\n const projectConfigManager = getAuth().projectConfigManager();\n\n try {\n const response = await projectConfigManager.updateProjectConfig(updateRequest);\n // Updated project config\n console.log('Project configuration updated successfully:', response);\n } catch (error) {\n console.error('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`."]]