PlaidLink.Maui 1.0.9

dotnet add package PlaidLink.Maui --version 1.0.9
                    
NuGet\Install-Package PlaidLink.Maui -Version 1.0.9
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PlaidLink.Maui" Version="1.0.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PlaidLink.Maui" Version="1.0.9" />
                    
Directory.Packages.props
<PackageReference Include="PlaidLink.Maui" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PlaidLink.Maui --version 1.0.9
                    
#r "nuget: PlaidLink.Maui, 1.0.9"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PlaidLink.Maui@1.0.9
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PlaidLink.Maui&version=1.0.9
                    
Install as a Cake Addin
#tool nuget:?package=PlaidLink.Maui&version=1.0.9
                    
Install as a Cake Tool

PlaidLink.Maui

NuGet License: MIT

A modern, cross-platform .NET library for integrating Plaid Link on iOS and Android. Provides a clean, unified API for Plaid Link integration in .NET MAUI, Xamarin, and native .NET mobile apps.

Features

  • Simple, intuitive API with fluent builder pattern
  • Cross-platform support for iOS and Android
  • Type-safe with full nullability annotations
  • Zero configuration - auto-detects platform
  • Modern .NET 10 targeting
  • Comprehensive documentation with XML comments
  • Async-friendly callback architecture

Installation

Install via NuGet Package Manager:

dotnet add package PlaidLink.Maui

Or via Package Manager Console:

Install-Package PlaidLink.Maui

Known Issues - Android

Duplicate Compose Runtime Classes: If you encounter the error Type androidx.compose.runtime.Stable is defined multiple times, add this to your project:

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
    <PackageReference Include="Xamarin.AndroidX.Compose.Runtime.Annotation.Jvm" Version="1.10.0.1" 
                      ExcludeAssets="all" PrivateAssets="all" />
</ItemGroup>

This is a known issue with AndroidX binding dependencies and is not specific to PlaidLink.Maui.

Quick Start

Basic Usage

using PlaidLink.Maui;

// Simple API
PlaidLink.Open(
    linkToken: "link-sandbox-xxx",
    onSuccess: success =>
    {
        Console.WriteLine($"Connected to {success.InstitutionName}");
        Console.WriteLine($"Public Token: {success.PublicToken}");
        
        // Send publicToken to your server to exchange for access_token
        await ExchangePublicToken(success.PublicToken);
    },
    onExit: exit =>
    {
        if (exit.ErrorMessage != null)
        {
            Console.WriteLine($"Error: {exit.ErrorMessage}");
        }
        else
        {
            Console.WriteLine("User exited Plaid Link");
        }
    }
);

Fluent Builder Pattern

using PlaidLink.Maui;

PlaidLink.CreateBuilder()
    .WithLinkToken(linkToken)
    .OnSuccess(success =>
    {
        // Handle successful connection
        var accounts = success.Accounts;
        foreach (var account in accounts)
        {
            Console.WriteLine($"  - {account.Name} ({account.Mask})");
        }
    })
    .OnExit(exit =>
    {
        // Handle exit or error
        Console.WriteLine($"Exited: {exit.ErrorMessage ?? "User cancelled"}");
    })
    .OnEvent(evt =>
    {
        // Track user interactions (optional)
        Console.WriteLine($"📊 Event: {evt.EventName}");
    })
    .Open();

Platform Setup

Android Setup

  1. Update your AndroidManifest.xml:
<manifest>
    <uses-permission android:name="android.permission.INTERNET" />
    
    <application>
        
    </application>
</manifest>
  1. Initialize Platform in MainActivity:
public class MainActivity : MauiAppCompatActivity
{
    protected override void OnCreate(Bundle? savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        
        // This is required for MAUI apps
        Microsoft.Maui.ApplicationModel.Platform.Init(this, savedInstanceState);
    }
}

iOS Setup

  1. Update your Info.plist:
<dict>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <false/>
    </dict>
</dict>
  1. No additional code required - the library automatically finds the root view controller.

Advanced Usage

Handling Success

PlaidLink.Open(
    linkToken: linkToken,
    onSuccess: success =>
    {
        // Success data includes:
        var publicToken = success.PublicToken;           // Exchange for access_token
        var institutionId = success.InstitutionId;       // Bank ID
        var institutionName = success.InstitutionName;   // Bank name
        var linkSessionId = success.LinkSessionId;       // Session identifier
        
        // Iterate through connected accounts
        foreach (var account in success.Accounts)
        {
            var accountId = account.Id;                  // Account ID
            var accountName = account.Name;              // e.g., "Checking"
            var accountMask = account.Mask;              // Last 4 digits
            var accountType = account.Type;              // e.g., "depository"
            var accountSubtype = account.Subtype;        // e.g., "checking"
        }
        
        // Exchange token on your backend
        await YourApiClient.ExchangePlaidToken(publicToken);
    },
    onExit: exit => { /* ... */ }
);

Handling Exit/Errors

onExit: exit =>
{
    if (exit.ErrorCode != null)
    {
        // An error occurred
        Console.WriteLine($"Error Code: {exit.ErrorCode}");
        Console.WriteLine($"Error Type: {exit.ErrorType}");
        Console.WriteLine($"Error Message: {exit.ErrorMessage}");
        
        // Log for debugging
        Logger.LogError(
            "Plaid Link error: {ErrorCode} - {ErrorMessage}",
            exit.ErrorCode,
            exit.ErrorMessage
        );
    }
    else
    {
        // User closed the flow without completing
        Console.WriteLine("User exited Plaid Link");
    }
    
    // Always available
    Console.WriteLine($"Session ID: {exit.LinkSessionId}");
    Console.WriteLine($"Request ID: {exit.RequestId}");
}

Tracking Events (Analytics)

PlaidLink.CreateBuilder()
    .WithLinkToken(linkToken)
    .OnSuccess(success => { /* ... */ })
    .OnExit(exit => { /* ... */ })
    .OnEvent(evt =>
    {
        // Track user interactions for analytics
        Analytics.Track("PlaidLinkEvent", new
        {
            EventName = evt.EventName,
            Institution = evt.InstitutionName,
            SessionId = evt.LinkSessionId,
            Timestamp = evt.Timestamp
        });
        
        // Common events:
        // - OPEN
        // - SEARCH_INSTITUTION
        // - SELECT_INSTITUTION
        // - SUBMIT_CREDENTIALS
        // - HANDOFF
        // - And many more...
    })
    .Open();

Architecture

Project Structure

PlaidLink.Maui/
├── PlaidLink.cs                      # Main entry point
├── PlaidLinkBuilder.cs               # Fluent builder
├── IPlaidLinkService.cs              # Core interface & models
├── Platforms/
│   ├── Android/
│   │   └── PlaidLinkService.cs       # Android implementation
│   └── iOS/
│       └── PlaidLinkService.cs       # iOS implementation
└── PlaidLink.Maui.csproj

Dependency Injection

For advanced scenarios, you can use dependency injection:

// In your DI setup (e.g., MauiProgram.cs)
builder.Services.AddSingleton<IPlaidLinkService>(sp =>
{
#if ANDROID
    return new PlaidLink.Maui.Platforms.Android.PlaidLinkService();
#elif IOS
    return new PlaidLink.Maui.Platforms.iOS.PlaidLinkService();
#else
    throw new PlatformNotSupportedException();
#endif
});

// In your view model or service
public class BankingViewModel
{
    private readonly IPlaidLinkService _plaidLink;
    
    public BankingViewModel(IPlaidLinkService plaidLink)
    {
        _plaidLink = plaidLink;
    }
    
    public void ConnectBank(string linkToken)
    {
        _plaidLink.Open(linkToken, OnSuccess, OnExit);
    }
}

Security Best Practices

  1. Never hardcode link tokens - always fetch from your secure backend
  2. Exchange tokens on your backend - never expose access_tokens in mobile apps
  3. Use HTTPS for all API communications
  4. Implement token expiration handling
  5. Log errors securely without exposing sensitive data

Troubleshooting

Android: "No current Android Activity found"

Solution: Make sure you call Platform.Init() in your MainActivity.OnCreate():

protected override void OnCreate(Bundle? savedInstanceState)
{
    base.OnCreate(savedInstanceState);
    Microsoft.Maui.ApplicationModel.Platform.Init(this, savedInstanceState);
}

iOS: "No root view controller found"

Solution: Ensure your app has completed UI initialization before calling PlaidLink.Open(). Consider delaying the call until ViewDidAppear:

public override void ViewDidAppear(bool animated)
{
    base.ViewDidAppear(animated);
    PlaidLink.Open(linkToken, OnSuccess, OnExit);
}

Platform Requirements

Platform Minimum Version Target Framework
Android API 23 (6.0) net10.0-android
iOS iOS 15.0 net10.0-ios

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support


Made for the .NET community

Product Compatible and additional computed target framework versions.
.NET net10.0-android36.0 is compatible.  net10.0-ios26.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.9 360 3/10/2026
1.0.8 101 3/10/2026
1.0.7 104 3/10/2026
1.0.6 99 3/9/2026
1.0.5 98 3/9/2026
1.0.2 106 3/9/2026
1.0.1 106 3/9/2026
1.0.0 103 3/9/2026