Flutter + Firebase: how to send email verification

Viewed 2560

I tried to read online and can't find an answer on how to use the sendSignInLinkToEmail()

In particular I'm interested in what actionCodeSettings is and what value it should have. Ty in advance.

Future verificationEmail(email) async {
  try { 
     FirebaseAuth.instance.sendSignInLinkToEmail(
                                      email: email,
                                      actionCodeSettings: null
      } catch (err) { 
          print(err);
            }
}
                               
2 Answers

[NEW FORMAT]

_firebaseAuthInstance.sendSignInLinkToEmail(
    email: "rocky_balboa@example.com,
    actionCodeSettings: ActionCodeSettings(
        url: "https://example.page.link/cYk9",
        androidPackageName: "com.example.app",
        iOSBundleId: "com.example.app",
        handleCodeInApp: true,
        androidMinimumVersion: "16",
        androidInstallApp: true),
  );

[DEPRECATED] (yeah, already...)

FirebaseAuth.instance.sendSignInLinkToEmail(
      email: "example@example.com",
      actionCodeSettings: ActionCodeSettings(
        url: "https://example.web.app",
        android: {
          'packageName': "com.example.example",
          'installApp': true,
          'minimumVersion': '12'
        },
        iOS: {
          'bundleId': "com.example.example",
        },
        handleCodeInApp: true,
      ),
    );
Related