# How to Migrate from Firebase Dynamic Links to Redirectly > Step-by-step guide to migrating your Flutter app from Firebase Dynamic Links to Redirectly. Keep your deep links working with our drop-in SDK. - Canonical: https://redirectly.app/blog/migrating-from-firebase-dynamic-links - Site: [Redirectly](https://redirectly.app) — deferred deep linking for Flutter & React Native - Published: 2024-02-15 - Author: Dmytro Vyrych - Category: Migration · 10 min read With Firebase Dynamic Links (FDL) shutting down, mobile developers need a reliable alternative. Here is a complete guide to switching your Flutter app to Redirectly with minimal code changes. ## Why Migrate? Google announced the deprecation of Firebase Dynamic Links, leaving many developers searching for a replacement. Redirectly was built specifically to fill this gap, offering a similar "deferred deep linking" capability but with a focus on the Flutter ecosystem. See our full comparison: [Firebase Dynamic Links Alternative](https://redirectly.app/firebase-dynamic-links-alternative.md). The migration process involves three main steps: 1. Setting up your project in Redirectly 2. Configuring your domain and native platforms 3. Replacing the Flutter SDK code ### Step 1: Create Your Redirectly Project First, sign up for a free account on the [Redirectly Dashboard](https://dashboard.redirectly.app/dashboard). Create a new project and note down your **API Key**. You will need this to initialize the SDK. ### Step 2: Replace Dependencies Remove the `firebase_dynamic_links` package from your `pubspec.yaml` and add `flutter_redirectly`. ```diff dependencies: - firebase_dynamic_links: ^5.4.0 + flutter_redirectly: ^1.0.0 ``` ### Step 3: Initialize the SDK In your `main.dart`, replace the Firebase initialization with Redirectly. For detailed implementation instructions, check out our [Flutter Deferred Deep Linking guide](https://redirectly.app/flutter-deferred-deep-linking.md) and [React Native Deferred Deep Linking guide](https://redirectly.app/react-native-deferred-deep-linking.md). ```dart // OLD: Firebase await Firebase.initializeApp(); // NEW: Redirectly final redirectly = FlutterRedirectly(); await redirectly.initialize( RedirectlyConfig( apiKey: 'YOUR_API_KEY', enableDebugLogging: kDebugMode, ), ); ``` ### Step 4: Handle Incoming Links The API for listening to links is very similar. Redirectly provides a stream for foreground clicks and a method for initial links. #### Foreground Listeners ```dart // OLD: Firebase FirebaseDynamicLinks.instance.onLink.listen((dynamicLinkData) { final Uri deepLink = dynamicLinkData.link; // Handle link }); // NEW: Redirectly redirectly.onLinkClick.listen((linkClick) { final Uri deepLink = linkClick.originalUrl; // or linkClick.link.target // Handle link }); ``` #### Initial Link (App Launch) ```dart // OLD: Firebase final PendingDynamicLinkData? initialLink = await FirebaseDynamicLinks.instance.getInitialLink(); // NEW: Redirectly final LinkClick? initialLink = await redirectly.getInitialLink(); ``` ### Step 5: Update AndroidManifest & Info.plist Just like with FDL, you need to register your domain for Android App Links and iOS Universal Links. - **Android:** Update your `intent-filter` host to match your Redirectly custom domain (e.g., `app.redirectly.app` or your own domain). - **iOS:** Update your `Associated Domains` entitlement to include your new domain. ### Step 6: Creating Links If you generate links programmatically, switch to the Redirectly API: ```dart // NEW: Redirectly final link = await redirectly.createLink( slug: 'promo-2024', target: 'https://myapp.com/promo', metadata: { 'campaign': 'spring_sale', 'source': 'instagram' } ); print(link.shortUrl); // https://your.domain/promo-2024 ``` ## Conclusion Migrating to Redirectly gives you full control over your deep links with a modern, supported platform. If you have any questions during migration, check out our [documentation](https://docs.redirectly.app) or [start building free deep links today](https://redirectly.app/index.md). --- Full site index for AI agents: https://redirectly.app/llms.txt