Skip to content

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:

dependencies:
  movable_ink: ^2.3.0

Then run:

flutter pub get

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:

  1. Add Associated Domains capability in Xcode
  2. Add your MovableInk domain: applinks:mi.yourcompany.com
  3. Add movable_ink_universal_link_domains to Info.plist

Android Configuration

Follow these steps from the Android Quick Start:

  1. Add intent filters to AndroidManifest.xml
  2. Set android:autoVerify="true"
  3. Configure all required path prefixes (/p/cpm, /p/rpm, /p/gom)

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

  1. Build and run your app on iOS or Android
  2. Test with a MovableInk link (ask your team for a test link)
  3. Check the console for: Deeplink resolved to: https://...

It Works!

If you see the resolved URL in the console, your integration is working!

Next Steps