Skip to main content
net8.0net8.0-android34.0net8.0-ios17.0

Android App Links and Apple Universal Links for .NET MAUI apps

Published
Jan 22, 2025
1y ago
Total Downloads
4.6K
4,571

Install

dotnet add package AppLinks.MAUI --version 1.0.4-pre
ProductVersions
.NET
net8.0net8.0-android34.0net8.0-ios17.0

README

AppLinks.MAUI

Version Downloads

This library offers camera preview and barcode scanning functionality for .NET MAUI apps using native platform APIs with Google ML Kit and Apple VisionKit.

Download and Install AppLinks.MAUI

This library is available on NuGet: https://www.nuget.org/packages/AppLinks.MAUI Use the following command to install AppLinks.MAUI using NuGet package manager console:

PM> Install-Package AppLinks.MAUI

You can use this library in any .NET MAUI project compatible to .NET 8 and higher.

App Link Setup for Android Apps
  1. Register app link host in MainActivity by creating one or more IntentFilter with DataScheme and DataHost.
  2. Create assetlinks.json file which contains Android package name(s) and sha256_fingerprints used to sign the package.
  3. Deploy assetlinks.json file to root web folder .well-known.
  4. Verify the app links for each package name: adb shell pm verify-app-links --re-verify {package_name}
  5. Check if verification was successful: adb shell pm get-app-links {package_name}
App Link Setup for iOS Apps
  1. Login to https://developer.apple.com, go to "Certificates, Identifiers & Profiles", select tab "Identifiers".
  2. Select the app identifier which should support app links.
  3. Enable the option "Associated Domains" and save the changes.
  4. Update and download all dependent provisioning profiles.
  5. Create Entitlements.plist file under Platforms/iOS and add associated domains (plist key: com.apple.developer.associated-domains).
  6. Create apple-app-site-associate file which contains app identifiers and target URL paths.
  7. Deploy apple-app-site-associate file to root web folder .well-known.
App Setup in .NET MAUI
  1. This plugin provides an extension method for MauiAppBuilder UseAppLinks which ensure proper startup and initialization. Call this method within your MauiProgram just as demonstrated in the AppLinksDemoApp:
    var builder = MauiApp.CreateBuilder()
        .UseMauiApp<App>()
        .UseAppLinks();
    

API Usage

Inject IAppLinkHandler or use the static singleton instance IAppLinkHandler.Current in your code to get access to the main features of this library.

  • IAppLinkHandler.AppLinkReceived: This event is fired as soon as an app link URL is received.
  • IAppLinkHandler.ResetCache(): Clear any cached app link data.

If an app link is received before the AppLinkReceived event is subscribed, the received app link URL is cached and delivered as soon as the event is subscribed.

App links offer a potential attack vector into your app, so ensure you validate all URI parameters and discard any malformed URIs.

Contribution

Contributors welcome! If you find a bug or you want to propose a new feature, feel free to do so by opening a new issue on github.com.

Links

Changes from Previous Version

No structural changes between v1.0.3-pre and v1.0.4-pre.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

This version is marked prerelease. Validate its API and upgrade path before production use.No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.