So far, I've made the backend updates, however, the documentation isn't clear on how to handle the client side signInWithEmailLink() using this new method.
Right now, my dynamic link simply opens the app to the main entry page and runs this action to check for the dynamic link:
```// Automatic FlutterFlow imports
import '/backend/backend.dart';
import '/backend/schema/structs/index.dart';
import '/actions/actions.dart' as action_blocks;
import 'package:ff_theme/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/actions/index.dart'; // Imports other custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import 'package:firebase_dynamic_links/firebase_dynamic_links.dart';
import '/backend/api_requests/api_calls.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:mixpanel_flutter/mixpanel_flutter.dart';
import 'dart:developer' as developer;
Future<void> getMagicLink() async {
//magicLinkErrored state is used in this action
//to show the user an error message on the welcome screen
FFAppState().magicLinkErrored = false;
try {
PendingDynamicLinkData? dynamicLinkData =
await FirebaseDynamicLinks.instance.getInitialLink();
if (dynamicLinkData != null) {
Uri? deepLink = dynamicLinkData.link;
bool validLink =
FirebaseAuth.instance.isSignInWithEmailLink(deepLink.toString());
if (validLink) {
//on signIn, App will navigate to transition screen automatically
try {
await FirebaseAuth.instance.signInWithEmailLink(
email: FFAppState().appEmail,
emailLink: deepLink.toString(),
);
} catch (error) {
await LoggerCall.call(
message:
'getMagicLink on open listener errored when signing in : $error',
source: FFDevEnvironmentValues().DATASOURCE,
);
}
FFAppState().magicLinkErrored = false;
} else {
FFAppState().magicLinkErrored = true;
}
}
} catch (error) {
developer.log("Error in getMagicLink: $error");
await LoggerCall.call(
message: 'Error in getMagicLink when opened with a link: $error',
source: FFDevEnvironmentValues().DATASOURCE,
);
FFAppState().magicLinkErrored = true;
}
//always open a listener to cover cases when logging out and logging back in without a restart
FirebaseDynamicLinks.instance.onLink.listen((dynamicLinkData) async {
Uri? deepLink = dynamicLinkData.link;
bool validLink =
FirebaseAuth.instance.isSignInWithEmailLink(deepLink.toString());
if (validLink) {
//on signIn, App will navigate to transition screen automatically
try {
await FirebaseAuth.instance.signInWithEmailLink(
email: FFAppState().appEmail,
emailLink: deepLink.toString(),
);
} catch (error) {
await LoggerCall.call(
message:
'getMagicLink open listener errored when signing in : $error',
source: FFDevEnvironmentValues().DATASOURCE,
);
}
FFAppState().magicLinkErrored = false;
} else {
FFAppState().magicLinkErrored = true;
String link = deepLink.toString();
await LoggerCall.call(
message: 'getMagicLink open listener returned an invalid link: $link',
source: FFDevEnvironmentValues().DATASOURCE,
);
}
});
}
// Set your action name, define your arguments and return parameter,
// and then add the boilerplate code using the button on the right!
However, you can see that I am using the FirebaseDynamicLinks package to get this done. Well the new email shouldn't be a dynamic link so I am not sure how to use it. The migration documentation seems to allude to there being no changes needed on the client side from the previous implementation, but that is under the Android/Ios documentation specifically. There is nothing under the flutter documentation yet.
Did you check FlutterFlow's Documentation for this topic?