[[["容易理解","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-07-25 (世界標準時間)。"],[],[],null,["\u003cbr /\u003e\n\nYou can pass state via a continue URL when sending email actions for password\nresets or verifying a user's email. This provides the user the ability to be\nreturned to the app after the action is completed. In addition, you can specify\nwhether to handle the email action link directly from a mobile application when\nit is installed instead of a web page.\n\nThis can be extremely useful in the following common scenarios:\n\n- A user, not currently logged in, may be trying to access content that\n requires the user to be signed in. However, the user might have forgotten\n their password and therefore trigger the reset password flow. At the end of\n the flow, the user expects to go back to the section of the app they were\n trying to access.\n\n- An application may only offer access to verified accounts. For\n example, a newsletter app may require the user to verify their email before\n subscribing. The user would go through the email verification flow and expect\n to be returned to the app to complete their subscription.\n\n- In general, when a user begins a password reset or email verification flow on\n an Apple app they expect to complete the flow within the app; the ability to\n pass state via continue URL makes this possible.\n\nHaving the ability to pass state via a continue URL is a powerful feature that\nFirebase Auth provides and which can significantly enhance the user experience.\n\nPassing state/continue URL in email actions\n\nIn order to securely pass a continue URL, the domain for the URL will need to\nbe allowlisted in the Firebase console.\nThis is done in the **Authentication** section by adding this domain to the\nlist of **Authorized domains** under the **Sign-in method** tab if it is not already there.\n\nAn `ActionCodeSettings` instance needs to be provided when sending\na password reset email or a verification email. This interface takes the\nfollowing parameters:\n\nThe following example illustrates how to send an email verification link that\nwill open in a mobile app first as a Firebase Dynamic Link using the custom\ndynamic link domain `example.page.link`\n(iOS app `com.example.ios` or Android app `com.example.android` where the app\nwill install if not already installed and the minimum version is `12`). The\ndeep link will contain the continue URL payload\n`https://www.example.com/?email=user@example.com`. \n\n final user = FirebaseAuth.instance.currentUser;\n\n final actionCodeSettings = ActionCodeSettings(\n url: \"http://www.example.com/verify?email=${user?.email}\",\n iOSBundleId: \"com.example.ios\",\n androidPackageName: \"com.example.android\",\n );\n\n await user?.sendEmailVerification(actionCodeSettings);\n\nConfiguring Firebase Dynamic Links\n\nFirebase Auth uses [Firebase Dynamic Links](/docs/dynamic-links) when sending a\nlink that is meant to be opened in a mobile application. In order to use this\nfeature, Dynamic Links need to be configured in the Firebase Console.\n\n1. Enable Firebase Dynamic Links:\n\n 1. In the Firebase console, open the **Dynamic Links** section.\n\n 2. If you have not yet accepted the Dynamic Links terms and created a Dynamic Links\n domain, do so now.\n\n 3. If you already created a Dynamic Links domain, take note of it. A Dynamic Links\n domain typically looks like the following example:\n\n ```\n example.page.link\n ```\n\n \u003cbr /\u003e\n\n 4. You will need this value when you configure your Apple or Android app to\n intercept the incoming link.\n\n2. Configuring Android applications:\n\n 1. If you plan on handling these links from your Android application, the Android 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. You will also need to configure the intent filter for the deep link in you AndroidManifest.xml file.\n 3. For more on this, refer to [Receiving Android Dynamic Links instructions](/docs/dynamic-links/android/receive).\n3. Configuring Apple applications:\n\n 1. If you plan on handling these links from your application, the bundle ID needs to be specified in the Firebase Console project settings. In addition, the App Store ID and the Apple Developer Team ID also need to be specified.\n 2. You will also need to configure the FDL universal link domain as an Associated Domain in your application capabilities.\n 3. If you plan to distribute your application to iOS versions 8 and under, you will need to set your bundle ID as a custom scheme for incoming URLs.\n 4. For more on this, refer to [Receiving Apple platforms Dynamic Links instructions](/docs/dynamic-links/ios/receive).\n\nHandling email actions in a web application\n\nYou can specify whether you want to handle the action code link from a web\napplication first and then redirect to another web page or mobile application\nafter successful completion, provided the mobile application is available.\nThis is done by setting `handleCodeInApp` to `false` in the `ActionCodeSettings` object. While\na bundle ID\nor Android package name are not required, providing them will allow the user\nto redirect back to the specified app on email action code completion.\n\nThe web URL used here, is the one configured in the email action templates\nsection. A default one is provisioned for all projects. Refer to\n[customizing email handlers](/docs/auth/custom-email-handler) to learn more on\nhow to customize the email action handler.\n\nIn this case, the link within the `continueURL` query parameter will be\nan FDL link whose payload is the `URL` specified in the `ActionCodeSettings`\nobject. While you can intercept and handle the incoming link from your app\nwithout any additional dependency, we recommend using the FDL client library to\nparse the deep link for you.\n\nWhen handling email actions such as email verification, the action code from the\n`oobCode` query parameter needs to be parsed from the deep link and then applied\nvia `applyActionCode` for the change to take effect, i.e. email to be verified.\n\nHandling email actions in a mobile application\n\nYou can specify whether you want to handle the action code link within your\nmobile application first, provided it is installed. With Android applications,\nyou also have the ability to specify via the `androidInstallApp` that\nthe app is to be installed if the device supports it and it is not already\ninstalled.\nIf the link is clicked from a device that does not support the mobile\napplication, it is opened from a web page instead.\nThis is done by setting `handleCodeInApp` to `true` in the `ActionCodeSettings` object. The\nmobile application's Android package name or bundle ID will also need to be\nspecified.The fallback web URL used here, when no mobile app is available, is\nthe one configured in the email action templates section. A default one is\nprovisioned for all projects. Refer to\n[customizing email handlers](/docs/auth/custom-email-handler) to learn more on\nhow to customize the email action handler.\n\nIn this case, the mobile app link sent to the user will be an FDL link whose\npayload is the action code URL, configured in the Console, with the query\nparameters `oobCode`, `mode`, `apiKey` and `continueUrl`. The latter will be the\noriginal `URL` specified in the\n`ActionCodeSettings` object. While you can intercept and handle the\nincoming link from your app without any additional dependency, we recommend\nusing the FDL client library to parse the deep link for you. The action code can\nbe applied directly from a mobile application similar to how it is handled from\nthe web flow described in the\n[customizing email handlers](/docs/auth/custom-email-handler) section.\n\nWhen handling email actions such as email verification, the action code from the\n`oobCode` query parameter needs to be parsed from the deep link and then applied\nvia `applyActionCode` for the change to take effect, i.e. email to be verified."]]