Flutter Quick Start
Get MovableInk deeplinking working in your Flutter app in under 10 minutes.
Prerequisites
Before you begin, ensure you have:
- [x] Your MovableInk subdomain (e.g.,
mi.yourcompany.com) - [x] AASA and Digital Asset Links files configured by MovableInk
- [x] Flutter >=2.5.0
- [x] iOS deployment target of iOS 13.0+
- [x] Android minSdkVersion of 24+
Need Help?
If you don't have these prerequisites, see the Getting Started guide or contact your Movable Ink client experience team.
Step 1: Install the SDK
Add the MovableInk SDK to your pubspec.yaml:
Then run:
Step 2: Configure Native Platforms
Since Flutter builds native iOS and Android apps, you need to configure each platform:
iOS Configuration
Follow these steps from the iOS Quick Start:
- Add Associated Domains capability in Xcode
- Add your MovableInk domain:
applinks:mi.yourcompany.com - Add
movable_ink_universal_link_domainsto Info.plist
Android Configuration
Follow these steps from the Android Quick Start:
- Add intent filters to AndroidManifest.xml
- Set
android:autoVerify="true" - Configure all required path prefixes (
/p/cpm,/p/rpm,/p/gom)
Step 3: Handle Incoming Links
In your main Dart file:
import 'package:flutter/material.dart';
import 'package:movable_ink/movable_ink.dart';
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final MovableInk _movableInkPlugin = MovableInk();
StreamSubscription? _linkSubscription;
@override
void initState() {
super.initState();
_initDeepLinking();
}
void _initDeepLinking() {
// Listen for deeplinks
_linkSubscription = _movableInkPlugin.subscribeToResolvedURL((String? url) {
if (url != null) {
print('Deeplink resolved to: $url');
// TODO: Navigate to appropriate screen
_handleDeeplink(url);
}
});
}
void _handleDeeplink(String url) {
// Parse the URL and navigate
final uri = Uri.parse(url);
if (uri.path.contains('/products/')) {
// Navigate to product detail
// Navigator.pushNamed(context, '/product', arguments: productId);
} else if (uri.path.contains('/categories/')) {
// Navigate to category
}
}
@override
void dispose() {
_linkSubscription?.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Your App',
home: YourHomePage(),
);
}
}
Step 4: Verify It Works
- Build and run your app on iOS or Android
- Test with a MovableInk link (ask your team for a test link)
- Check the console for:
Deeplink resolved to: https://...
It Works!
If you see the resolved URL in the console, your integration is working!