使用 Xamarin.forms 并在 NuGetPackages 上获取 AndroidAppLinks 我能够将链接关联到我的应用程序并使其打开我想要的页面。我正在尝试对 iOS 做同样的事情。对此,我有两个问题:
- 这种事情存在吗?
- 我该怎么做?
我已经在 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/