maui-deep-linking

在 .NET MAUI 应用中实现深度链接的指南。涵盖 Android 应用链接(Intent 过滤器、Digital Asset Links、AutoVerify)、iOS 通用链接(关联域权限、Apple 應用站点关联文件)、自定义 URI 方案,以及两个平台的域名验证和从 URL 打开应用与传入 URL 的处理。适用场景包括深度链接、应用链接、通用链接、自定义 URI 方案、Intent 过滤器、关联域、Digital Asset Links、从 URL 打开应用与域名验证。非适用:应用内 Shell 导航(请使用 maui-shell-navigation)、推送通知处理(请使用 maui-push-notifications)或 Web 内容嵌入(请使用 maui-hybridwebview)。

仓库最近推送
GitHub Stars
181
Forks
21
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "maui-deep-linking":https://skillpi.com/zh/skills/deepskill-c7721d5fbe1756d7021d9687c04a0c5016652bbfc5295971b5d7d668a44c4050。安装前核对上游来源和版本:https://github.com/davidortinau/maui-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

在 .NET MAUI 应用中实现深度链接的指南。涵盖 Android 应用链接(Intent 过滤器、Digital Asset Links、AutoVerify)、iOS 通用链接(关联域权限、Apple 應用站点关联文件)、自定义 URI 方案,以及两个平台的域名验证和从 URL 打开应用与传入 URL 的处理。适用场景包括深度链接、应用链接、通用链接、自定义 URI 方案、Intent 过滤器、关联域、Digital Asset Links、从 URL 打开应用与域名验证。非适用:应用内 Shell 导航(请使用 maui-shell-navigation)、推送通知处理(请使用 maui-push-notifications)或 Web 内容嵌入(请使用 maui-hybridwebview)。

0 下载

介绍来源: third_party · davidortinau · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: maui-deep-linking
description: >
  Guide for implementing deep linking in .NET MAUI apps. Covers Android App Links
  with intent filters, Digital Asset Links, and AutoVerify; iOS Universal Links with
  Associated Domains entitlements and Apple App Site Association files; custom URI
  schemes; and domain verification for both platforms.
  USE FOR: "deep linking", "app links", "universal links", "custom URI scheme",
  "intent filter", "Associated Domains", "Digital Asset Links", "open app from URL",
  "handle incoming URL", "domain verification".
  DO NOT USE FOR: in-app Shell navigation (use maui-shell-navigation),
  push notification handling (use maui-push-notifications), or web content embedding (use maui-hybridwebview).

.NET MAUI Deep Linking

Platform Gotchas

Android

  • AutoVerify = true is required on the IntentFilter for App Links (not just deep links). Without it, Android shows a disambiguation dialog instead of opening your app directly.
  • Handle intent in both OnCreate and OnNewIntent. OnCreate fires for cold starts; OnNewIntent fires when the app is already running. Missing either means links silently fail in one scenario.
// ❌ Only handles cold-start links
protected override void OnCreate(Bundle? savedInstanceState)
{
    base.OnCreate(savedInstanceState);
    HandleDeepLink(Intent);
}

// ✅ Handles both cold-start and warm-start links
protected override void OnCreate(Bundle? savedInstanceState)
{
    base.OnCreate(savedInstanceState);
    HandleDeepLink(Intent);
}
protected override void OnNewIntent(Intent? intent)
{
    base.OnNewIntent(intent);
    HandleDeepLink(intent);
}
  • SHA-256 fingerprint must match the signing key used for the build you're testing. Debug and release builds use different keys — update assetlinks.json accordingly or verification silently fails.
  • Test verification status with:
    adb shell pm get-app-links com.example.myapp

    Look for verified status, not just ask.

iOS

  • ⚠️ Universal Links do NOT work in the Simulator. You must test on a physical device.
  • AASA changes take up to 24 hours to propagate through Apple's CDN (iOS 14+). During development, use the ?mode=developer query param or Apple's CDN diagnostics: swcutil dl -d example.com.
  • Handle all three entry points: FinishedLaunching, ContinueUserActivity, and SceneWillConnect. Missing any one causes links to fail for specific app states (cold start, background resume, or scene-based launch).
  • applinks: prefix is required in the Associated Domains entitlement. Writing just example.com instead of applinks:example.com silently fails.

Common Mistakes

Forgetting MainThread.BeginInvokeOnMainThread

Deep link callbacks can fire on background threads. Shell navigation must run on the main thread.

// ❌ May crash — GoToAsync called off the main thread
static void HandleUniversalLink(string? url)
{
    if (string.IsNullOrEmpty(url)) return;
    Shell.Current.GoToAsync(MapToRoute(url));
}

// ✅ Dispatch to main thread
static void HandleUniversalLink(string? url)
{
    if (string.IsNullOrEmpty(url)) return;
    MainThread.BeginInvokeOnMainThread(async () =>
        await Shell.Current.GoToAsync(MapToRoute(url)));
}

Route not registered before navigation

Register Shell routes in AppShell constructor before any deep link can fire. If the route doesn't exist, GoToAsync throws silently or navigates to root.

Custom URI schemes vs. App Links / Universal Links

Approach Verified Fallback to browser Recommended
Custom URI scheme (myapp://) No No Only for app-to-app communication
Android App Links (https://) Yes Yes ✅ Production web links
iOS Universal Links (https://) Yes Yes ✅ Production web links

⚠️ Custom URI schemes are not verified — any app can register the same scheme. Use https:// App Links / Universal Links for user-facing URLs.


Debugging Checklist

  • [ ] Android: IntentFilter has AutoVerify = true on MainActivity
  • [ ] Android: assetlinks.json at /.well-known/ with correct SHA-256 for current signing key
  • [ ] Android: Intent handled in both OnCreate and OnNewIntent
  • [ ] Android: Verified with adb shell pm get-app-links
  • [ ] iOS: applinks:example.com in Associated Domains entitlement (not just example.com)
  • [ ] iOS: AASA file at /.well-known/apple-app-site-association with correct Team ID
  • [ ] iOS: All three lifecycle entry points handled
  • [ ] iOS: Tested on physical device (not simulator)
  • [ ] Shell routes registered before deep link callbacks fire
  • [ ] Navigation dispatched to main thread

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值90/100

亮点

  • 涵盖 Android App Links、iOS Universal Links 和自定义 URI 方案的完整实现指南
  • 提供平台差异说明和常见错误排查清单,实用性强
触发精准90/100

亮点

  • 触发词覆盖全面,包括 'deep linking'、'app links'、'universal links' 等核心术语
  • 明确区分了适用与不适用场景,边界清晰
结构规范85/100

待提升项

  • 缺少端到端完整示例 原报告严重程度:轻微

    文档提供了代码片段和常见错误示例,但缺少一个完整的端到端实现示例

    改进建议:建议补充一个完整的端到端示例,展示从配置到处理的完整流程

亮点

  • 结构清晰,分为平台差异、常见错误和调试清单三个主要部分
  • 提供了详细的平台差异说明和常见错误排查清单
执行可靠85/100

待提升项

  • 缺少不可逆操作确认机制说明 原报告严重程度:轻微

    文档未提及对不可逆操作的确认机制,如删除或修改关键配置时的用户确认

    改进建议:建议在涉及关键配置修改时添加用户确认机制的说明

亮点

  • 提供了详细的调试清单和常见错误排查方法
  • 代码示例中包含了线程安全的处理方式
证据可验 (前四项均值)88/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。