sojo_link 0.0.3 copy "sojo_link: ^0.0.3" to clipboard
sojo_link: ^0.0.3 copied to clipboard

A Flutter plugin for handling dynamic links with SojoLink

sojo_link #

Firebase Dynamic Links is shutting down in August 2025. SojoLink is your solution. With this package you can quickly migration existing Firebase Dynamic Links to SojoLink.

pub package

Getting Started #

Setup your project with SojoLink and get started: https://sojolink.com

Setup #

  1. Sign up at https://sojolink.com
  2. Create a new project
  3. Navigate to Project Configuration

2. Configure your apps #

Android Configuration

Add your Android app with the following details:

  • App name
  • Associated domain
  • Package name
  • SHA256 fingerprint

iOS Configuration

Add your iOS app with the following details:

  • App name
  • Associated domain
  • Bundle ID
  • Team ID
  • Paths

After configuring your apps:

  1. Navigate to "Dynamic Links" in your SojoLink dashboard
  2. Click "Create Dynamic Link"
  3. Configure your link:
    • Enter the Deep Link URL (the path you want to open in your app)
    • Set link behavior for iOS/Android
    • Configure fallback URLs for when the app isn't installed
    • Add optional UTM parameters for campaign tracking
  4. Save your dynamic link to generate a short link
  5. Use this short link in your marketing materials, social media, or sharing features

Installation #

Add the following to your pubspec.yaml:

dependencies:
  sojo_link: ^latest_version

Run:

flutter pub get

Platform Integration #

Android Setup #

Add the following to your AndroidManifest.xml inside the <application> tag:

<activity
    android:name=".MainActivity"
    android:launchMode="singleTask"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data
            android:scheme="https"
            android:host="www.example.com" />
    </intent-filter>
</activity>

Note: Replace www.example.com with the deep link you added while creating dynamic links in your SojoLink project.


iOS Setup #

Update your Info.plist file with:

<!-- Custom URL Scheme -->
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>YOUR_DOMAIN</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>sojo-link</string> <!-- Replace with your  custom URL scheme -->
        </array>
    </dict>
</array>

<!-- Universal Links -->
<key>com.apple.developer.associated-domains</key>
<array>
    <string>applinks:YOUR_DOMAIN</string> <!-- Replace with your actual domain -->
</array>

Note: Use the same domain that you configured for your dynamic links in your SojoLink project.


Usage #

import 'package:sojo_link/sojo_link.dart';

void main() {
  runApp(MyApp());
}

You can listen for dynamic links in your StatefulWidget:

import 'dart:developer';
import 'package:sojo_link/sojo_link.dart';

class _MyHomePageState extends State<MyHomePage> {
  String deepLink = '';
  Map<String, String> utmParam = {};

  @override
  void initState() {
    super.initState();
    initDynamicLinks();
  }

  void initDynamicLinks() {
    SojoLink.instance.onLink.listen((pendingDynamicLink) {
      log("AppLink: ${pendingDynamicLink.link.toString()}");
      setState(() {
        deepLink = pendingDynamicLink.link.toString();
        utmParam = pendingDynamicLink.utmParameters;
      });
      
      // Handle the link here, e.g., navigate to a specific screen
      final Uri deepLinkUri = pendingDynamicLink.link;
      Navigator.pushNamed(context, deepLinkUri.path);
    });
  }
  
  // Rest of your widget implementation
}

The PendingDynamicLink class provides:

class PendingDynamicLink {
  /// The dynamic link that was opened.
  final Uri link;
  
  /// Optional utm parameters from the dynamic link.
  final Map<String, String> utmParameters;
  
  PendingDynamicLink({
    required this.link,
    this.utmParameters = const {},
  });
}

8
likes
150
points
333
downloads

Publisher

verified publishertruenary.com

Weekly Downloads

A Flutter plugin for handling dynamic links with SojoLink

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on sojo_link