c# - 使用 xamarin.forms 的 iOS 应用程序链接

标签 c# ios xamarin.forms applinks

使用 Xamarin.forms 并在 NuGetPackages 上获取 AndroidAppLinks 我能够将链接关联到我的应用程序并使其打开我想要的页面。我正在尝试对 iOS 做同样的事情。对此,我有两个问题:

  1. 这种事情存在吗?
  2. 我该怎么做?

我已经在 App.xaml.cs 上重写了方法 protected override void OnAppLinkRequestReceived(Uri uri),我还使用 Application.Current.AppLinks.RegisterLink( entry) 并且我尝试更改 Info.plist 添加此条目:

<key>CFBundleURLTypes</key>
  <array>
    <dict>
      <key>CFBundleURLName</key>
      <string>http://relacionamento.com.br/senha</string>
      <key>CFBundleURLTypes</key>
      <string>Viewer</string>
      <key>CFBundleURLSchemes</key>
      <array>
        <string>example</string>
      </array>
    </dict>
  </array>

我尝试过使用 Rivets,但我得到的是用于 Android 的:

Severity Code Description Project File Line Suppression State Error Could not install package 'Microsoft.Bcl.Build 1.0.14'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 0

对于 iOS 来说:

Severity Code Description Project File Line Suppression State Error Could not install package 'Microsoft.Bcl.Build 1.0.14'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

尝试以表单安装,我得到:

Severity Code Description Project File Line Suppression State Error Could not install package 'Rivets 1.0.5'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 0

我必须使用铆钉吗? 我还需要什么才能使用这些链接?

最好的问候

最佳答案

Android App Links 的 iOS 等效项称为 Universal Links,并在 iOS 9 中引入。据我所知,没有用于在 Xamarin 上启用 Universal Links 的 Nuget 包,但有一个非常详细的设置一切可用的演练 here .

铆钉包适用于 Facebook App Links — 一个完全不同的标准,恰好具有相同的名称。

一次处理所有这些事情的替代方法是 Branch.io (全面披露:我在 Branch 团队)深度链接平台。这是 available as a Nuget package你可以找到完整的文档 here .

关于c# - 使用 xamarin.forms 的 iOS 应用程序链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40159743/

相关文章:

ios - UIViewController 与继承

Xamarin 表单 : CachingStrategy not available

c# - Xamarin Forms 条目中的删除线文本

c# - 如何使用 Distinct 操作创建索引。乌鸦数据库

c# - 使用 C# 中的 powershell cmdlet 重启 Hyper V 机器

c# - Linq:添加额外的 'Where' 子句给出随机结果

c# - TcpClient 已连接但服务器未收到消息

iphone - 如何随着值的变化增加和减少 uislider 中的圆圈大小

ios - 是否可以从后台模式或应用程序被终止时打开 ViewController?

xamarin - 在同一 View 下绑定(bind)命令和CommandParameter