简体   繁体   English

在Xamarin表单中为Windows.UWP应用设置URL方案?

[英]Set URL-Scheme for Windows.UWP app in xamarin forms?

I want to access my windows uwp app on windows with a URL-Scheme, like [ spotify:// ] I got it working on android by placing IntentFilter(new[] { Intent.ActionView }, DataScheme = "myapp", Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }) in MainActivity.cs, but I cant get it to work on windows. 我想使用URL方案在Windows上访问我的Windows uwp应用程序,例如[spotify://]我通过将IntentFilter(new[] { Intent.ActionView }, DataScheme = "myapp", Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }) MainActivity.cs中的IntentFilter(new[] { Intent.ActionView }, DataScheme = "myapp", Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }) ,但是我无法在Windows上使用它。

How do you select the URL-Scheme for an xamarin forms uwp app? 如何为Xamarin表单uwp应用程序选择URL方案?

Solved it by following: https://docs.microsoft.com/en-us/windows/uwp/xbox-apps/automate-launching-uwp-apps 通过以下方法解决此问题: https : //docs.microsoft.com/zh-cn/windows/uwp/xbox-apps/automate-launching-uwp-apps

The main problem I had was that I taught you must have :// in the end, but that didn't launch the app, In actuality, you must end the url Scheme with just ":". 我遇到的主要问题是,我教您必须在末尾加://,但这并不能启动应用程序。实际上,您必须在URL Scheme后面仅加上“:”。 ( myapplication: works, but myapplication:// only works on android) (myapplication:有效,但myapplication://仅适用于android)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM