AppLinks.MAUI
Android App Links and Apple Universal Links for .NET MAUI apps
Install
| Product | Versions |
|---|---|
| .NET |
README
AppLinks.MAUI
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
- Register app link host in
MainActivityby creating one or moreIntentFilterwithDataSchemeandDataHost. - Create
assetlinks.jsonfile which contains Android package name(s) and sha256_fingerprints used to sign the package. - Deploy
assetlinks.jsonfile to root web folder.well-known. - Verify the app links for each package name:
adb shell pm verify-app-links --re-verify {package_name} - Check if verification was successful:
adb shell pm get-app-links {package_name}
App Link Setup for iOS Apps
- Login to https://developer.apple.com, go to "Certificates, Identifiers & Profiles", select tab "Identifiers".
- Select the app identifier which should support app links.
- Enable the option "Associated Domains" and save the changes.
- Update and download all dependent provisioning profiles.
- Create
Entitlements.plistfile under Platforms/iOS and add associated domains (plist key: com.apple.developer.associated-domains). - Create
apple-app-site-associatefile which contains app identifiers and target URL paths. - Deploy
apple-app-site-associatefile to root web folder.well-known.
App Setup in .NET MAUI
- This plugin provides an extension method for MauiAppBuilder
UseAppLinkswhich ensure proper startup and initialization. Call this method within yourMauiProgramjust 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
AppLinkReceivedevent 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
- https://developer.apple.com
- https://developer.apple.com/documentation/xcode/supporting-associated-domains
- https://developer.android.com/training/app-links
- https://developers.google.com/digital-asset-links/tools/generator
- https://learn.microsoft.com/en-us/dotnet/maui/android/app-links
- https://learn.microsoft.com/en-us/dotnet/maui/macios/universal-links
- https://branch.io/resources/aasa-validator
Changes from Previous Version
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.