You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Xamarin Forms深度链接配置后无法唤起应用求助

以下是针对你的Xamarin.Forms应用配置App Links后无法唤起的排查步骤:

  • 确认https://polis.ateshgah.com/.well-known/assetlinks.json文件存在且可访问,格式需严格符合要求:
    [{
      "relation": ["delegate_permission/common.handle_all_urls"],
      "target": {
        "namespace": "android_app",
        "package_name": "你的应用完整包名",
        "sha256_cert_fingerprints": ["应用签名的SHA256指纹"]
      }
    }]
    
  • 注意debug和release包的SHA256指纹完全不同,可通过以下命令获取:
    keytool -list -v -keystore 你的签名文件路径 -alias 别名
    
  • 检查服务器返回该文件的Content-Type必须为application/json,不能是text/plain。

2. 检查IntentFilter配置细节

  • 确认MainActivity上的IntentFilter属性无拼写错误,AutoVerify = true需同时对应网站配置和应用签名;
  • 确保应用包名与assetlinks.json中的package_name完全一致(区分大小写);
  • 已正确添加CategoryDefault和CategoryBrowsable,你的现有配置这部分没问题。

3. Xamarin.Forms AppLinks初始化检查

  • 确认AndroidAppLinks.Init(this)的调用位置正确,需在LoadApplication之前执行:
    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        AndroidAppLinks.Init(this);
        LoadApplication(new App());
    }
    
  • 检查Xamarin.Forms.AppLinks NuGet包版本与Xamarin.Forms主版本兼容,建议更新到最新稳定版。

4. 工具测试与日志排查

  • 用adb命令直接测试Intent唤起:
    adb shell am start -W -a android.intent.action.VIEW -d "https://polis.ateshgah.com/"
    
    如果能唤起应用,说明IntentFilter配置有效,问题出在AutoVerify或浏览器支持;
  • 查看AutoVerify状态:
    adb shell dumpsys package domain-preferred-apps | grep polis.ateshgah.com
    
    若返回status=always则验证通过,ask或never表示验证失败;
  • 查看logcat日志,搜索AppLinks、IntentFilter或assetlinks关键词,定位验证失败的具体原因。

5. 其他注意事项

  • 仅Android 6.0(API 23)及以上版本支持App Links;
  • 应用需通过签名安装(debug签名或release签名),直接调试运行可能影响AutoVerify;
  • 部分第三方浏览器可能不支持App Links,优先用Chrome测试。

内容的提问来源于stack exchange,提问作者Emin Niftiyev

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 16:57:38